I am expected to make (small) changes to the legacy SQL application on Microsoft SQL Server 2008. It uses several databases, many stored procedures, functions, and some CLR assemblies.
There is no big-picture documentation, only some common knowledge in the heads of the people around.
What tools do you use when you search for say all places where the stored procedure is called? I am not the experienced SQL developer. My experience fits better with programming languages where source code is stored in text files rather than in the databases.
What tools would you recommend to learn the content of the legacy SQL application?
Thanks, Petr
For the specific question:
You can use brute force, though this will lead to some false positives where the procedure name is simple and may appear in code naturally (even as part of another object name), or in comments:
This also doesn’t capture calls to the procedure that are built with dynamic SQL, but I don’t think there is a perfect all-encompassing solution for this problem anyway. You can also discover cases where the stored procedure is being called by a job:
(Same caveats exist for false positives and dynamic SQL there, as well as nested procedure calls which won’t be caught even if they are relevant.)
Some other ideas: