sql to identify db objects that depend on a particular table?

  • Hi, Can you recommend any SQL that can be used to identify all objects that depend on a particular table? For example, sprocs, functions, views, etc.

  • Are you looking for something like this?

    EXEC sp_depends 'Schema.Object'

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • You can also query sys.sydepends for more information. This is nice since you can join to it in SQL statements, unlike a stored procedure. There's more info at:

    https://msdn.microsoft.com/en-us/library/ms190325.aspx

  • mtlsql (7/7/2015)


    You can also query sys.sydepends for more information. This is nice since you can join to it in SQL statements, unlike a stored procedure. There's more info at:

    https://msdn.microsoft.com/en-us/library/ms190325.aspx%5B/quote%5D

    Which is exactly what sp_depends does as you can check by using sp_helptext.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply