Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need list of sprocs using key tables

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-10-17 : 11:13:47
We're converting several tables to new table names and field names. We have reporting that use sprocs which call those current tables/fields.

My challenge and question is how to run some kind of script that would return a list identifying those sprocs that reference the tables that are being converted and will no longer be used effective a certain date.

It is critical that we include all the sprocs that will be affected by this cut-over, but we're trying to avoid checking one sproc at a time. This would be very counter-productive.

P.S. My co-worker ran some code which did list most of the sprocs affected, but it left out some too. What we learned is that his script is limiting the search to the first 4000 position, so if the table is referenced after 4000, it wouldn't pick it up.

thx,

John

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-17 : 11:16:27
try using sp_depends system stored procedure. syntax is as follows

http://msdn.microsoft.com/en-us/library/ms189487.aspx
Go to Top of Page
   

- Advertisement -