Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

To Find jobs related to a particular database. Expand / Collapse
Author
Message
Posted Tuesday, February 5, 2013 2:12 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
All,

If you have 10 databases mirrored and if you only failing over 5 of them....you only need to disable the jobs related to that databases that you are failing over.....so, how can you get that list of jobs using t-sql. Please advise.

Thanks,
SueTons.


Regards,
SQLisAwe5oMe.
Post #1416095
Posted Tuesday, February 5, 2013 2:17 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:49 PM
Points: 2,927, Visits: 3,151
Check out sysjobs and sysjobsteps in the msdb database.
Post #1416099
Posted Tuesday, February 5, 2013 3:23 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
JeremyE (2/5/2013)
Check out sysjobs and sysjobsteps in the msdb database.


Does anyone have any script for this?....Basically, I am looking for a script to get all the jobs with job names for a particular database and with execute command to disable those jobs....so, that I can copy the output and execute to disable them before I failover the database. Hope my requirement is clear.

SueTons.


Regards,
SQLisAwe5oMe.
Post #1416128
Posted Tuesday, February 5, 2013 4:38 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:04 AM
Points: 35,546, Visits: 32,140
JeremyE was trying to teach you something new, Sue. Take a look at the two tables he recommended and you'll see how easy it is to do.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1416160
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse