Question

I have used sp_depends first time like this

sp_depends TestTable

As result I got some stored procedures and views. Now when I look (Ctrl F for TestTable) at script of stored procedures and views I do not see that they would be referring to TestTable.

If not using script is there any other dependency could be there? If yes how?

Was it helpful?

Solution

sp_depends is prehistoric and unreliable.

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use sys.dm_sql_referencing_entities and sys.dm_sql_referenced_entities instead.

Even better, consider using Red Gate's free SQL Search tool...

OTHER TIPS

I wrote a stored procedure to search all stored procedures in all databases for text and displays the database name, stored procedure name, and an example of how the text is used. You can also specify two words and it will display only the stored procedures using both words. This is good for searching for a table name and the word INSERT for instance.

If you call it without any parameters, it will give you help on how to use it. I also have other database procedure tools in my GitHub.

sp_FindInAllProcs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top