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

execute a ssis package using xp_cmdshell Expand / Collapse
Author
Message
Posted Tuesday, November 11, 2008 1:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 5, 2012 4:51 AM
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
Post #600455
Posted Tuesday, November 11, 2008 1:31 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, November 14, 2014 8:57 AM
Points: 1,391, Visits: 609
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).




Post #600463
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse