Impact Analysis - Tables

  • We have an environment where tables are just hanging around.  I want to start cleaning them up but before I do I want to determine if they are referenced in any stored procedures, user defined functions, or DTS Packages.  What is the easiest way to do this?  Any sys tables out there I can query?

    Thanks in advance

  • You could try sp_depends to start.  Be aware that doesn't list cross-database dependencies and it might not list other dependencies.  See this forum thread:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=9&messageid=19637

    Greg

    Greg

  • Also, you can query syscomments table to find if there is table name in procedure code:

    SELECT o.name FROM SYSCOMMENTS c JOIN SYSOBJECTS o ON c.ID= c.ID WHERE c.text LIKE '%YourTableName%'

  • Thanks to everyone for responding.  Two more questions ... will syscomments work if comments were not saved?  Will this solution capture DTS, Stored PRocedure, Trigger, and UDF impacts?

     

    Thanks Again, : )

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

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