SSIS: Calling dtsx using xp_cmdshell in SQL Server 2008- error on task - with Execute Process Task (error: "No process is associated with this object)

  • Does anyone know why I am getting his error when using xp_cmdshell to execute my package via SQL Server 2008? It is running successfully in the command line and in visual studio. I am in admin in SQL and box.

    My Package contains: two dataflows, a foreach loop container (inside of it it has an Execution Process task).

    Execution Process task calls winzip64.exe to create a zip file and then inserts all the files within the folder to the zip file.

    CODE:

    DECLARE @ReturnCodeAS INT

    EXEC @ReturnCode = xp_cmdshell 'dtexec /f "E:\SSISFolder\Package.dtsx"'

    ERROR:

    Microsoft (R) SQL Server Execute Package Utility

    Version 10.50.2500.0 for 64-bit

    Copyright (C) Microsoft Corporation 2010. All rights reserved.

    NULL

    Started: 12:40:56 PM

    Progress: 2013-12-19 12:40:57.02

    Source: Execute Process Task

    Operation Complete: 0% complete

    End Progress

    Error: 2013-12-19 12:40:57.02

    Code: 0xC002F304

    Source: Execute Process Task

    Description: An error occurred with the following error message: "No process is associated with this object.".

    End Error

    Progress: 2013-12-19 12:40:57.02

    Source: Execute Process Task

    Operation Complete: 100% complete

    End Progress

    Warning: 2013-12-19 12:40:57.02

    Code: 0x80019002

    Source: Foreach Loop Container

    Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specifie

    d in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

    End Warning

    Warning: 2013-12-19 12:40:57.02

    Code: 0x80019002

    Source: Package

    Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specifie

    d in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

    End Warning

    DTExec: The package execution returned DTSER_FAILURE (1).

    Started: 12:40:56 PM

    Finished: 12:40:57 PM

    Elapsed: 0.796 seconds

    NULL

  • Since an execute process task calls a command I would surmise you don't have the executable set correctly for that process.. And I would guess that the other two errors are related. Without knowing more about the package we can't offer much.

    CEWII

  • The Executable Process Task is set up correctly. It runs successfully while running the SSIS package and command line.

    Executable Process task details in SSIS (this executable task is inside a ForEachLoop Container)

    Under Process Category (in Execute process task editor)

    Executable: Winzip64.exe

    Argument: -min -m -en "E:\SSISPackage\OUTPUT.ZIP""E:\SSISPackage\"

    Working directory: C:\Program~1\WinzipOutput: SSIS package run successfully manually.

    Code for Command Prompt is below:

    Code to use on cmd line: dtexec /f "E:\SSISLocation\Package.dtsx"

    Output: It is able to call the SSIS package successfully.

    Code run in SQL browser (it fails here - not prompting and creating the zip file:

    USE master

    Go

    DECLARE @ReturnCd AS INT

    EXEC @ReturnCd = xp_cmdshell 'dtexec /f "E:\SSISLocation\Package.dtsx:'

    Output: It is not running... It doesn't create the zip file and move all the files in the directory into the zip file. I get the error shown in my message. Any ideas?

  • What is the difference in permissions between the SQL Server and the user running it at the command line? I'm guessing that the working directory may not allowed for the the SQL Server. Does SQL run as a user with administrator rights or not?

    CEWII

  • Yes, I have full permissions (am an administrator in sql and the box). I also gave permissions to the folders.

    My guess is that xp_cmdshell isn't capable in prompting the winzip64 executable because it doesn't create a zip file. It's all I came up with for now.

  • Try running this to check the account that xp_cmdshell is using - it probably is not yours:

    xp_cmdshell 'whoami.exe'

    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

  • I have checked the whoami for xp_cmdshell. It has been fixed because I no longer get an error, but it is just now dragging/hanging. It's not doing anything. Keeps going on and on...

    ----Below is how i checked the whoami.

    DECLARE @Results table(

    ID int identity(1,1) NOT NULL,

    TheOutput varchar(1000))

    insert into @Results (TheOutput)

    exec master..xp_cmdshell 'whoami'

    insert into @Results (TheOutput)

    exec master..xp_cmdshell 'cd %userprofile%' -

    select * from @Results

    ------------

    ------------

    It looks like it's hanging.

    I also try a simple task:

    exec xp_cmdshell 'C:\"Program Files "\WinZip\wzzip.exe -a e:\test\ZippedFileName.zip e:\test\*.TXT'

    but it just hangs...too...

    I can execute the same code "(exec xp_cmdshell 'C:\"Program Files "\WinZip\wzzip.exe -a e:\test\ZippedFileName.zip e:\test\*.TXT')" above on a different server and it is working fine, but the other server is using an old wzzip.exe (the 32 not the 64).

  • Update: I think it is the updated wzzip executable used on winzip64 that is the issue.

    I had IT Security install the old version of wzzip.exe used for winzip32 and it zipped up the files using the sql script.

    Gonna try my package to see if i am not getting an error. Stay tune...

Viewing 8 posts - 1 through 7 (of 7 total)

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