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


execute a ssis package using xp_cmdshell


execute a ssis package using xp_cmdshell

Author
Message
arun-471488
arun-471488
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 11
Hi All ,
I have a problem executing a ssis package using the xp_cmdshell command. I built a string with all parameters for ssis and passed the string to the cmd shell as argument. Here is a code sample.

Please advice me on this issue.

Code
----------------------------------------------------------------------------------
declare @cmd nvarchar(4000)
declare @final_str varchar(8000)
declare @returncode varchar(100)
set @cmd='''dtexec /sq "Maintenance Plans"\MarketOnce\PMTA\pmta /set \package.variables[User::FilePath].Value;\\svrrbidevdb01\c$\Services\me\marketonce\pmta_accounting\pending\ /set \package.variables[User::FileName].Value;acct-2008-11-07-0036.csv /set \package.variables[User::JobIDValue].Value;89'''
select @cmd
set @final_str = cast(@cmd as varchar(8000))
exec @returncode = master..xp_cmdshell @final_str
select @returncode


Error Description:
---------------------------------------------------------------------------------
''dtexec' is not recognized as an internal or external command,operable program or batch file.

Thank You,
Arun Vempati
Kishore.P
Kishore.P
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1699 Visits: 619
arun (11/11/2008)
Hi All ,
I have a problem executing a ssis package using the xp_cmdshell command. I built a string with all parameters for ssis and passed the string to the cmd shell as argument. Here is a code sample.

Please advice me on this issue.

Code
----------------------------------------------------------------------------------
declare @cmd nvarchar(4000)
declare @final_str varchar(8000)
declare @returncode varchar(100)
set @cmd='''dtexec /sq "Maintenance Plans"\MarketOnce\PMTA\pmta /set \package.variables[User::FilePath].Value;\\svrrbidevdb01\c$\Services\me\marketonce\pmta_accounting\pending\ /set \package.variables[User::FileName].Value;acct-2008-11-07-0036.csv /set \package.variables[User::JobIDValue].Value;89'''
select @cmd
set @final_str = cast(@cmd as varchar(8000))
exec @returncode = master..xp_cmdshell @final_str
select @returncode


Error Description:
---------------------------------------------------------------------------------
''dtexec' is not recognized as an internal or external command,operable program or batch file.

Thank You,
Arun Vempati


Arun,

mention the "dtexec.exe" file complete path (eg: C:\Program Files\Microsoft SQL Server\90\Tools\Binn\dtexec.exe).



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