May 3, 2011 at 2:49 pm
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
May 3, 2011 at 3:26 pm
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 4, 2011 at 1:45 am
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;-)
May 4, 2011 at 7:29 am
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".
May 4, 2011 at 7:42 am
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 4, 2011 at 8:16 am
from ssms
May 4, 2011 at 8:20 am
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 4, 2011 at 8:32 am
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
May 4, 2011 at 8:36 am
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 4, 2011 at 8:40 am
"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /f "C:\Users\user1\Desktop\package.dtsx"
May 4, 2011 at 8:43 am
That seems to print fine. I have seen it in the past where it was throwing that error but was actually referring to the second set of items being quoted (the stuff you have after the /f). Try it without quoting that second file path.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 4, 2011 at 8:51 am
wow! thank you so much.
it worked without double quotes in the second part.
May 4, 2011 at 10:09 am
Excellent - glad it worked.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 20, 2012 at 2:24 am
Hi,
How to add parameters to run the package?
July 22, 2012 at 7:58 pm
springmoonjc (7/20/2012)
Hi,How to add parameters to run the package?
I got it. Thanks. 🙂
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply