/ Published in: SQL
Expand |
Embed | Plain Text
----Option 1 SELECT DISTINCT so.name FROM syscomments sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.TEXT LIKE '%tablename%' ----Option 2 SELECT DISTINCT o.name, o.xtype FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id WHERE c.TEXT LIKE '%tablename%'
Comments
Subscribe to comments
You need to login to post a comment.

How can I find if particular table is being used in the stored procedure? How to search in stored procedures? --Searching for Empoloyee table SELECT Name FROM sys.procedures WHERE OBJECTDEFINITION(OBJECTID) LIKE '%Employee%' GO --Searching for Empoloyee table and RateChangeDate column together SELECT Name FROM sys.procedures WHERE OBJECTDEFINITION(OBJECTID) LIKE '%Employee%' AND OBJECTDEFINITION(OBJECTID) LIKE '%RateChangeDate%' GO