Need to create a job for dynamic execution on another server

  • Hi all,

    I need to create a job to dynamically script out indexes and some other objects from Server A and apply them on Server B. They are linked through a Linked Server.

    But how to construct the job? I know how to build dynamic code, but how to save its output, and how to run it on another server?

    Thanks

     

  • Sounds like a dangerous thing to do in production

    Is this part of migration, a one time task or will you want your monster script to run regularly?

     

  • This is not from production. This is from one lower env. to another lower env. (like dev, test, qa, like that)

  • SQL Guy 1 wrote:

    Hi all,

    I need to create a job to dynamically script out indexes and some other objects from Server A and apply them on Server B. They are linked through a Linked Server.

    But how to construct the job? I know how to build dynamic code, but how to save its output, and how to run it on another server?

    Thanks

    You can create a job in server A to script out all indexes and save it as a file in a common location accessible for both servers.

    Another Job in Server B can fetch the file and run it in Server B.

    Normal jobs can do this task but prefer  SSIS, it will make your life simple for these kinda tasks.

  • Cebisa wrote:

    Sounds like a dangerous thing to do in production

    Is this part of migration, a one time task or will you want your monster script to run regularly?

    This is a good option when you do it from UAT or higher level in Non-Production to Dev and QA databases.

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

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