Skip to content

Instantly share code, notes, and snippets.

@kristinaconley
Created April 1, 2016 21:13
Show Gist options
  • Save kristinaconley/1c6d9f8ad267a9f4df45c9b6c00509d5 to your computer and use it in GitHub Desktop.
Save kristinaconley/1c6d9f8ad267a9f4df45c9b6c00509d5 to your computer and use it in GitHub Desktop.
Search all databases
exec sp_MSForEachDB
'
USE ?
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc,
m.definition
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON m.object_id = o.object_id
WHERE m.Definition LIKE ''%HQ-SQL-06%''
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment