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 12»»

xp_cmdshell exec ssis package in 32bit mode Expand / Collapse
Author
Message
Posted Tuesday, May 3, 2011 2:49 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:53 PM
Points: 44, Visits: 1,151
I have a package set to run in 32bit mode on a 64bit machine, and I need to put it in a stored procedure.

I can run the package in cmd prompt like:
"c:\program files (x86))\microsoft sql server\100\dts\binn\dtexec.exe" /f "c:\users\user1\desktop\package.dtsx"


I can also run a test package built in 64bit like:

declare @cmdtest varchar(200)
set @cmdtest = 'dtexec /f "C:\Users\user1\Desktop\testpackage.dtsx"'
exec master..xp_cmdshell @cmdtest



but when I run the one built in 32bit mode like:

declare @cmd varchar(200)
set @cmd = ' "c:\program files (x86)\microsoft sql server\100\dts\binn\dtexec.exe" /f "C:\Users\user1\Desktop\package.dtsx" '
exec master..xp_cmdshell @cmd

I got an error:
'c:\program' is not recognized as an internal or external command.

any idea? Thanks
Post #1102720
Posted Tuesday, May 3, 2011 3:26 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 1:37 PM
Points: 21,639, Visits: 15,309
It looks fine. Have you tried removing the leading space and the trailing space?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1102732
Posted Wednesday, May 4, 2011 1:45 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
its is happening because of white spaces in folder's name "program files"

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1102910
Posted Wednesday, May 4, 2011 7:29 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:53 PM
Points: 44, Visits: 1,151
I removed the leading and trailing space, still got the same error.

I thought double quotes would take care of spaces between folder names like "program files".
Post #1103107
Posted Wednesday, May 4, 2011 7:42 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 1:37 PM
Points: 21,639, Visits: 15,309
double quotes does take care of it. Where are you making this call? From ssms? From sqlagent? From somewhere else?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1103124
Posted Wednesday, May 4, 2011 8:16 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:53 PM
Points: 44, Visits: 1,151
from ssms
Post #1103176
Posted Wednesday, May 4, 2011 8:20 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 1:37 PM
Points: 21,639, Visits: 15,309
what do you get if you print the variable to screen after setting it?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1103185
Posted Wednesday, May 4, 2011 8:32 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:53 PM
Points: 44, Visits: 1,151
here is the error:

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NULL

the package has script task to execute crystal reports
Post #1103200
Posted Wednesday, May 4, 2011 8:36 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 1:37 PM
Points: 21,639, Visits: 15,309
comment out your exec statement and just print the variable
Like this:
print @cmd


Post the result of that print statement




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1103203
Posted Wednesday, May 4, 2011 8:40 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:53 PM
Points: 44, Visits: 1,151
"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /f "C:\Users\user1\Desktop\package.dtsx"
Post #1103210
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse