Skip to content

Instantly share code, notes, and snippets.

@alikrc
Last active July 4, 2018 13:48
Show Gist options
  • Select an option

  • Save alikrc/38c12657886326eba55c2b9c00bfc7e0 to your computer and use it in GitHub Desktop.

Select an option

Save alikrc/38c12657886326eba55c2b9c00bfc7e0 to your computer and use it in GitHub Desktop.
Its used for searching a keyword in all stored procedures func etc.sql
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN
sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%your keyword here%';
----------------------------------------------
/*use sp_helptext to see definiton of the sp or func*/
--sp_helptext spNameHere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment