SQL: How To Search All Files For Specific Text

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

This query shows how to search all the files associated with a database for specific text.

Copy this code and paste it in your HTML
  1. SELECT DISTINCT o.name AS Object_Name,o.type_desc
  2. FROM sys.sql_modules m
  3. INNER JOIN sys.objects o
  4. ON m.object_id=o.object_id
  5. WHERE m.definition LIKE '%YourSearchTextHere%'

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.