Technical Article

List of stored procedures which refer a DB table

,

It used to find stored procedures where a DB has been used.

/*
  Get the list Stored Procedures which uses a DB table  
  It used from syscomments, sysobjects table to gather information
  It may not be accurate if the DB is not refreshed
  
*/SELECT DISTINCT
  c.id,o.id, name 
FROM  syscomments c inner join sysobjects o  on c.id = o.id 
WHERE TEXT like '%Products%'  -- Product : Table Name
 AND o.xtype='P'
ORDER BY o.name

Rate

3.33 (3)

You rated this post out of 5. Change rating

Share

Share

Rate

3.33 (3)

You rated this post out of 5. Change rating