Running an SSIS Package using dtexec

后端 未结 2 1365
逝去的感伤
逝去的感伤 2020-11-29 12:54

I\'m running an SSIS package using dtexec. The package runs fine in BIDS on my system. When I create an SQL server agent job to run the package on a schedule. The package ru

相关标签:
2条回答
  • 2020-11-29 13:07

    The first error I would address is "The Excel Connection Manager is not supported in the 64-bit version of SSIS, as no OLE DB provider is available."

    The out of the box Excel drivers only exist in the 32 bit address space. BIDS/SSDT is a 32 bit application so Excel source and destinations work just fine. However, when you run them from the commandline/SQL Agent, then you need to explicitly use the 32 bit version of the DTEXEC program.

    Step 1, will be to ensure you can run the package from the command line on the server the agent executes on as yourself. Assuming your SQL Server is installed in the customary location, you probably have one of the following DTEXEC.exe available to you

    C:\Program Files\Microsoft SQL Server\90\DTS\Binn\DTExec.exe
    c:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe
    C:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTExec.exe
    C:\Program Files\Microsoft SQL Server\120\DTS\Binn\DTExec.exe
    C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\DTExec.exe
    C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe
    C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTExec.exe
    C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe
    

    You will want to use the (x86) version. Future readers, if you happen to be on a 32 version of Windows (Windows 2003, maybe), the first 3 will be the only options available to you. As Vivek's error message has indicated, he is executing an SSIS package in 64 bit mode.

    dtexec provides a command-line switch /X86 to allow you to seamlessly use the same executable for both 32 and 64 bit operations. LIES! The documentation does call that out but who reads documentation?

    This option is only used by SQL Server Agent. This option is ignored if you run the dtexec utility at the command prompt.

    So, you will need to run your package by providing the explicit path

    C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe /file C:\folder\GICSReport.dtsx

    I see "Failed to decrypt protected XML node" in your output and you also state you are using configuration files so you can most likely change your PackageProtectionLevel from the default EncryptSensitiveWithUserKey to DontSaveSensitive. That feature exists to prevent accidental exposure of sensitive data (passwords) but since you are already handling that with config files, that should not be an issue. ... That might actually be an error from one of the other package protection levels now that I think about it.

    At any rate, try running from the 32 bit executable first. If that doesn't work try changing the package protection level as indicated. If either of those make the package run as expected, then attempt to run the same command from the SQL Agent.

    If it all works, mark this as the answer. If not, please update the ticket with the current error being generated and we'll ask for more information.

    0 讨论(0)
  • 2020-11-29 13:20

    Here is the solution if you are trying to run a SSIS package with dtexec from transact SQL that contains an excel import.

    1. Create a batch file that contains the following code.

      cd C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\ DTEXEC.exe /DE "password" /F "C:\mySSISfolder\package.dtsx"

    2. Create a shortcut pointing at your batch file, set the properties\advanced on the shortcut to run as an administrator.

    3. from your transact sql procedure run the following command

      exec xp_cmdshell 'C:\myfolder\runssis_sc.lnk'

    0 讨论(0)
提交回复
热议问题