Passing Values into an SSIS Package at Runtime from Outside the Package

Who is online?  0 guests and 0 members
Home  »  Blogs  »  DevinKnight  »  Passing Values into an SSIS Package at Runtime from Outside the Package
 
0
/5
Avg: 0/5: (0 votes)

Comments (6)

Anil
Anil said:

Hello Devin,

Firstly, thanks for sharing this post and also I want to add something regarding passing values dynamically to SSIS package. In one of my package, I used the following script and execute package along with passing variable dynamically or outside the SSIS from SSMS.

DECLARE @ssis_cmd VARCHAR(4000)

DECLARE  @Packagepath VARCHAR(50)

DECLARE  @FileName VARCHAR(50)

SET @Packagepath = 'C:\Test_Xp_cmdshell\Package.dtsx' -- SSIS package location

SET @FileName = 'D:\SSIS\File.txt' --Passing dynamic variable i.e 'file location' into ssis package.

SELECT @ssis_cmd = 'dtexec /F "' + @Packagepath + '"'

SELECT @ssis_cmd =

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

EXEC master..xp_cmdshell @ssis_cmd

Regards,

Anil Maharjan

3/16/2011
 · 
 
by
DevinKnight
DevinKnight said:

Very nice! I like this method too!

3/16/2011
 · 
 
by
griffster
griffster said:
Can you have the sql agent job run via an xml configuration file but also override a particular variable value within that xml config file with a value I've set in Set Values? I have a package that runs with an end date variable that's pulled from the xml config file (along with 20 or so other variable settings). Within a certain SQL Agent Job that runs this package though, I want that it to run setting End Date equal to the time and date the job actually runs according to its job schedule.
10/24/2011
 · 
 
by
DevinKnight
DevinKnight said:
You could. If you add the config to the sql agent job it can apply it's value to your variable.
10/27/2011
 · 
 
by
mattfloyd
mattfloyd said:
I am using SQL Server for my package configurations. Can I dynamically pass the configuration filter in my dtexec command line. Why? Then we could have one package to sync our cubes and we would pass the configuration filter to that package which would tell it which cube to sync, etc. I know this is possible to do by using separate XML files. Just trying to do it using SQL Server Configuration. I am using SQL 2008.
1/31/2012
 · 
 
by
user711557
user711557 said:
I am using sql server 2008.my package configuration is sql server, I am passing value from sql job agent but it is not updating default value... Please assist me....
4/12/2012
 · 
 
by
Blogs RSS Feed

DevinKnight's latest blog posts

Blogs RSS Feed

Latest community blog posts