Find text in SQL Server Objects


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



Copy this code and paste it in your HTML
  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


Comments


You need to login to view comments.