Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

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) Expand / Collapse
Author
Message
Posted Thursday, December 19, 2013 2:03 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 24, 2014 5:55 PM
Points: 7, Visits: 35
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 @ReturnCode AS 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
Post #1524795
Posted Friday, December 20, 2013 12:00 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, January 03, 2014 3:52 PM
Points: 6,066, Visits: 5,277
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
Post #1525142
Posted Friday, December 20, 2013 2:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 24, 2014 5:55 PM
Points: 7, Visits: 35
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\Winzip\
Output: 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?
Post #1525178
Posted Friday, December 20, 2013 4:58 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, January 03, 2014 3:52 PM
Points: 6,066, Visits: 5,277
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
Post #1525213
Posted Friday, December 27, 2013 10:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 24, 2014 5:55 PM
Points: 7, Visits: 35
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.
Post #1526220
Posted Monday, December 30, 2013 6:56 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 4:25 AM
Points: 4,828, Visits: 11,184
Try running this to check the account that xp_cmdshell is using - it probably is not yours:

xp_cmdshell 'whoami.exe'




Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1526483
Posted Monday, December 30, 2013 12:33 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 24, 2014 5:55 PM
Points: 7, Visits: 35
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).


Post #1526587
Posted Monday, December 30, 2013 2:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 24, 2014 5:55 PM
Points: 7, Visits: 35
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...
Post #1526609
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse