Created
January 17, 2017 20:48
-
-
Save GER-NaN/6c14db46e81db8e0bb495cd66b0da333 to your computer and use it in GitHub Desktop.
Queries the Sql Server Job Steps for a specified search key
This file contains hidden or 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
| USE [msdb] | |
| GO | |
| --QUERIES the Job Steps for a specific search key. | |
| DECLARE @SearchKey VARCHAR(100) = 'dev' | |
| SELECT | |
| sysjobs.job_id, | |
| sysjobs.name, | |
| sysjobs.name, | |
| sysjobsteps.step_id, | |
| sysjobsteps.command, | |
| sysjobsteps.step_name | |
| FROM | |
| dbo.sysjobs INNER JOIN | |
| dbo.sysjobsteps ON sysjobsteps.job_id = sysjobs.job_id | |
| WHERE | |
| sysjobsteps.command LIKE N'%' + @SearchKey + '%' | |
| GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment