Posted By

brentgiesler on 10/04/11


Tagged


Versions (?)

Find text in SQL Server Objects


 / Published in: SQL
 

  1. DECLARE @Search varchar(255)
  2. SET @Search='text_to_search'
  3.  
  4. SELECT DISTINCT
  5. o.name AS Object_Name,o.type_desc
  6. FROM sys.sql_modules m
  7. INNER JOIN sys.objects o ON m.object_id=o.object_id
  8. WHERE m.definition LIKE '%'+@Search+'%'
  9. ORDER BY 2,1

Report this snippet  

You need to login to post a comment.