May 26, 2010 at 2:56 pm
Hello All,
in my ssis package i have a script task and data flow task
script task work is to open text file and make some changes to the data in file and it creates a new file with changed data
then data flow task reads data from file and write to sql table
example of script
Dim path As String = "C:\Feeds\SSIS\Input\mytextfile.txt"
Dim sr As StreamReader = New StreamReader(path)
Dim fileCreateDate As Date = File.GetCreationTime(path)
Dts.Variables.Item("User::FileCreatedDate").Value = fileCreateDate
line = sr.ReadLine()
If (line Is Nothing) Then Exit Do
If (Not (line.StartsWith(""""))) Then Continue Do
...............
...........
........
now what i am trying here is, in test environment the path is different, and also path is different in production
instead of changing every place the paths manually,. how can i set it up with variables so that i just change variables values when i configure ssis package in sql server jobs
or is there any other good ways to overcome this problem
please suggest me...
Thanks in advance
asita
May 26, 2010 at 3:06 pm
Use a config file to set up a package variable. Pass the package variable to the script task. Check out this link.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply