Executing a DTS package from Query Analyzer

  • Hi all.

    I realise there are plenty of posts for this problem but none of them seem to work out for me or require more SQL knowledge so i'm posting here.

    I have a DTS package on a SQL server (not a flat file stored on my machine or on the Network) and i'd like to kick off the DTS package directly from Query Analyzer. Should that work I would then paste that code into a JOB for scheduling overnight but i'd like to see if I can run it from QA first.

    I hoestly hoped it would be something as simple as:

    EXEC MyDB.DBO.MyDTS but no such joy.

    Can anyone assist me with the TSQL syntax for this code please?

    Thanks,

    Mitch

  • use xp_cmdshell to run from dos prompt

  • If your goal is to execute a package in a SQL Agent job, you can use DTSRUN in a job step. You should find details in Books Online. Look for "Scheduling a DTS Package for Execution".

    An example of DTSRUN in a job step:

    dtsrun/S instancename/N packagename

    Greg

  • Thanks guys.

    I went with the DTSRun option.

    Its now failing on a seperate issue, complaining about the ODBC in the DTS package itself which is strange as other JOBS already created use these ODBC connections works fine as does the DTS itself so I wonder if theSQL server running it does not recognise the ODBC connection?

    I'll play around with it.

    Thanks again.

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

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