SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS: Calling dtsx using xp_cmdshell in SQL Server 2008- error on task - with Execute Process Task...


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)

Author
Message
Analyst2006
Analyst2006
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 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
Elliott Whitlow
Elliott Whitlow
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44118 Visits: 5314
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
Analyst2006
Analyst2006
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 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?
Elliott Whitlow
Elliott Whitlow
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44118 Visits: 5314
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
Analyst2006
Analyst2006
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 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.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97704 Visits: 22005
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.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Analyst2006
Analyst2006
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 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).
Analyst2006
Analyst2006
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 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...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search