Create SQL agent job using XML file

  • Hello SQL friends,

    Does anyone know if it is possible to create multiple SQL agent jobs using an XML file? We are moving away from Control-M and I have an XML file with all the info that I need and would hate to have to recreate all of them from scratch.

    Any ideas?

    Thanks in advance for your continued support!

    The are no problems, only solutions. --John Lennon

  • SQLTougherGuy (3/2/2016)


    Hello SQL friends,

    Does anyone know if it is possible to create multiple SQL agent jobs using an XML file? We are moving away from Control-M and I have an XML file with all the info that I need and would hate to have to recreate all of them from scratch.

    Any ideas?

    Thanks in advance for your continued support!

    Not as far as I know.

    Can you somehow get a 'CREATE' script out of the XML file?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Hi Phil,

    If there is a way that I can separate the tags, maybe I can wrap this in dynamic SQL. I am thinking something like...

    @var = 'Create Job'+<NAME TAG>, etc, etc.

    But I am not sure how you can loop through the elements of an XML file. Perhaps that is the key?

    Thanks for your response.

    The are no problems, only solutions. --John Lennon

  • SQLTougherGuy (3/2/2016)


    Hi Phil,

    If there is a way that I can separate the tags, maybe I can wrap this in dynamic SQL. I am thinking something like...

    @var = 'Create Job'+<NAME TAG>, etc, etc.

    But I am not sure how you can loop through the elements of an XML file. Perhaps that is the key?

    Thanks for your response.

    That may indeed be the key.

    There are some guys here (not me, though!) who are very good at querying XML.

    If you can provide an example of the XML you wish to query, it would help a lot. Perhaps for a single simple job.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Phil,

    We are going to recreate the ControlM jobs manually due to the complexity of the processes, so this make my life easier somewhat, tedious, but easier.

    Thanks for you help as usual 😀

    The are no problems, only solutions. --John Lennon

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

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