sp_depends in SQL Server, what are possible dependencies?

pkwftd7m  于 11个月前  发布在  SQL Server
关注(0)|答案(2)|浏览(142)

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?

7eumitmz

7eumitmz1#

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

dohp0rv5

dohp0rv52#

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

相关问题