Find a Stored Procedure Related to Table in Database - Search in All Stored Procedure.
Sometimes we mite need to find a table used inside a Stored Procedure
we can check for a particular table being used or not before deleting or Modifying the Structure or Changing a Primary Key etc.
—-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%'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment