Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sp_depends in SQL Server, what are possible dependencies?

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?

like image 657
Pritesh Avatar asked Dec 26 '22 18:12

Pritesh


1 Answers

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...

like image 66
gbn Avatar answered Jan 28 '23 12:01

gbn