Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Calling SSIS package from Stored Procedure

$
0
0

Hi Experts,

I have a master package which calls a child package and child package calls one more package. The packages reside on file system. I have created a stored procedure in SQL Server 2012 to execute the packages. The snippet of sp and output of the query looks like below.

My problem is sp is not taking below parameters and instead run the ssis package with config file parameters. Is something wrong with below query because of which it is not running with these parameters? How can I force the sp to run with parameters I pass and not with the default config file paramaters?

Command –

SET @SQLQuery='DTExec /F '+@PackagePath+'\Master.dtsx '

SET@Params= '/SET \Package.Variables[User::v_PackagePath].Properties[Value];"'+@PackagePath+'"

               /SET \Package.Variables[User::v_DBConnection].Properties[Value];""\"'+@DBConnection+'"\"                       

               /SET \Package.Variables[User::v_OverrideUIFilePath].Properties[Value];'+CAST(@OverrideUIFilePathASVARCHAR(1))+'

               /SET \Package.Variables[User::v_Mode].Properties[Value];"'+@Mode+'"

               /SET \Package.Variables[User::v_Type].Properties[Value];'+CAST(TypeASVARCHAR(100))+'

               /SET \Package.Variables[User::v_FileName].Properties[Value];"'+@FileName+'"

               /SET \Package.Variables[User::v_Source].Properties[Value];"'+CAST(@SourceASVARCHAR(100))+'"

               /SET \Package.Variables[User::v_ID].Properties[Value];'+CAST(@IDASVARCHAR(100))+'

               /SET \Package.Variables[User::v_KeepParallelSupport].Properties[Value];'+CAST(@KeepParallelSupportASVARCHAR(1))+''

SET@SQLQuery= @SQLQuery+@Params     

print@SQLQuery

EXECmaster..xp_cmdshell@SQLQuery

O/p –

DTExec /F D:\Temp\Master.dtsx

/SET \Package.Variables[User::v_PackagePath].Properties[Value];"D:\Temp"           

/SET \Package.Variables[User::v_DBConnection].Properties[Value];""\"Data Source=ServerName;Initial Catalog=DBName;Provider=SQLNCLI11.1;Integrated Security=SSPI;"\"

/SET \Package.Variables[User::v_OverrideUIFilePath].Properties[Value];0

/SET \Package.Variables[User::v_Mode].Properties[Value];"regular"

/SET \Package.Variables[User::v_Type].Properties[Value];0

/SET \Package.Variables[User::v_FileName].Properties[Value];"C:\Exec\2.txt"

/SET \Package.Variables[User::v_Source].Properties[Value];"default"

/SET \Package.Variables[User::v_ID].Properties[Value];1

/SET \Package.Variables[User::v_KeepParallelSupport].Properties[Value];0

Thank you for your help!


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>