How to check the SSIS package job results after it has completed its execution?

前端 未结 4 1560
谎友^
谎友^ 2020-12-09 04:40

I have an SSIS package which imports the data into the SQL Server 2008 database. I have set up the schedule job in the SQL Server Agent to run that package. When I check th

4条回答
  •  渐次进展
    2020-12-09 05:32

    Here's another approach for when SQL Server job history is not showing output from SSIS packages: use DTEXEC command lines.

    (Upside: this approach puts the job's output where anyone else supporting it would expect to find it: in job history.
    Downside for big packages: if you have a long SSIS package, with lots of tasks or components, and lots of output, then the job history will split package output into many lines of job history, making the approach in the previous answer--logging to a table--easier to read.)

    To show SSIS package output in the job's View History:
    (1) Change the job steps from type "SQL Server Integration Services Package", to "Operating system (CmdExec)",
    (2) Use DTEXEC command lines, to execute the packages.

    Example of command line:

    DTExec /DTS "\MSDB\myPkgName" /DECRYPT pkgPass /MAXCONCURRENT " -1 " /CHECKPOINTING OFF 
    

    Note that if the SSIS package requires 32-BIT execution (true for exporting to Excel, for example), then use the DTEXEC utility in "Program Files (x86)" by fully qualifying it. Example, where the SQL Server application was installed on an "E:" drive, and where SQL Server 2014 is being used:

    "E:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /DTS "\MSDB\myPkgName" /DECRYPT pkgPass /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
    

    If your SSIS packages are in the file system (as ".dtsx" files), then replace "/DTS" with "/FILE".

    If your SSIS packages were placed in SSISDB (using the "project deployment model", which is available starting with SQL Server 2012, instead of the older "package deployment model"), then replace "/DTS" with "/ISSERVER".

    Next, go into the job step's "Advanced" page, and make sure that the box is checked for "Include step output in history".

    Lastly, consider your job step's "Run as": if your job steps "Run as" were already set to a proxy, on job steps of type "SQL Server Integration Services Package", then you already made that proxy active to the subsystem "SQL Server Integration Services Package". Now, to do command lines like the above, check the proxy's properties, and make sure it is also active to the subsystem "Operating system (CmdExec)".

    MSDN reference: SSIS Output on Sql Agent history

提交回复
热议问题