T-SQL for Sync SQL Agent Jobs between Instances

  • Hi everyone!...

    Anyone have a T-SQL for sync Jobs and his steps and schedules between instances... I mean, a T-SQL to Script-out all information related to a Jobs, and then use that result to re-create the same Jobs in another instance...

    Just to be clear... T-SQL that can have as result a "CREATE JOB" statement (I know that the real instruction is sp_add_job, sp_add_jobstep, sp_add_jobschedule and so on)

    Thanks a lot for all of you guys

  • Did you just try right clicking on a job and select 'Script Job as' option?

    It won't help you with synching jobs but that's not something I would normally want to do. I always want to verify any changes that I make. At least this makes migrating them easy.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • yb751 (5/6/2016)


    Did you just try right clicking on a job and select 'Script Job as' option?

    It won't help you with synching jobs but that's not something I would normally want to do. I always want to verify any changes that I make. At least this makes migrating them easy.

    Hi...

    That's a manually task... I'm looking for something automátic, a T-SQL that I can implement in a job or in a ETL or maybe in a trigger-fire action.

    Thanks for your time.

  • what did google search throw up for you?

    eg "ms sql script all agent jobs"

    lot s of answers

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • i have specific jobs that are identical on all servers, things like backups, statistics, indexing.

    i connect via Central Management servers, and run the create job script on all of them at the same time.

    nothing modifies them behind my back, so they are all the same when i deploy them.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply