Created
February 7, 2018 18:45
-
-
Save royashbrook/4a9ca0164f01b040780d38f65c7a280f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- search the jobs for a specific text | |
select | |
[InstanceName] = serverproperty('servername') | |
, j.job_id | |
, j.name | |
, js.step_id | |
, js.command | |
, j.enabled | |
from | |
msdb.dbo.sysjobs j | |
join msdb.dbo.sysjobsteps js on | |
js.job_id = j.job_id | |
where | |
js.command LIKE '%sometext%' -- replace keyword with the word or stored proc that you are searching for | |
-- search the sql code | |
select | |
routine_name | |
, routine_definition | |
, routine_type | |
from | |
information_schema.routines | |
where | |
routine_definition like '%sometext%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment