Find sp or table name in all stored procs


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ----Option 1
  2. SELECT DISTINCT so.name
  3. FROM syscomments sc
  4. INNER JOIN sysobjects so ON sc.id=so.id
  5. WHERE sc.TEXT LIKE '%tablename%'
  6. ----Option 2
  7. SELECT DISTINCT o.name, o.xtype
  8. FROM syscomments c
  9. INNER JOIN sysobjects o ON c.id=o.id
  10. WHERE c.TEXT LIKE '%tablename%'

URL: http://blog.sqlauthority.com/2006/12/10/sql-server-find-stored-procedure-related-to-table-in-database-search-in-all-stored-procedure/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.