Wednesday, 4 December 2013

How do I find what stored procedures contain a table in SQL

SELECT DISTINCT so.name  
FROM syscomments sc  
INNER JOIN sysobjects so ON sc.id=so.id  
WHERE sc.TEXT LIKE '%tablename%' 

No comments:

Post a Comment