Skip to content

Instantly share code, notes, and snippets.

@gabrielfreirebraz
Last active November 24, 2023 22:32
Show Gist options
  • Save gabrielfreirebraz/cdfdf4d7309e2a22183755fbb9c4986b to your computer and use it in GitHub Desktop.
Save gabrielfreirebraz/cdfdf4d7309e2a22183755fbb9c4986b to your computer and use it in GitHub Desktop.
How to find contents or names of procedures on SQL Server
SELECT
P.NAME,
C.TEXT
FROM
syscomments C
INNER JOIN
sys.procedures P
ON P.object_id = C.id
WHERE
C.TEXT LIKE '%PIECE_OF_CONTENT_TO_FIND%' -- contents to find within procs
AND P.NAME LIKE '%PROC_NAME_TO_FIND%' -- name to find for procs title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment