![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi. I have a dts package that loads data from a fixed length text file into a table. I would like to insert the filename into a column in the table so that I can track the records inserted from which source file. I have the script to get the filename, but I don't know how to pass this information to the data transform task into the "sourcefile" column. Can I assign it to a global variable and use the variable as constant in the task? Any help would be appreciated. Thanks. -Terry -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums...r-dts/200507/1 |
#3
| |||
| |||
|
|
Ok So I presume you have a column in the destination to hold the variable value. I do not know how your transforms are set up but here is one way of doing this and I do it all the time. In the destination columns list in the transformations tab select the destination column you want to be populated. Create a new Active Script transform In the properties of the transform make sure no source columns are chosen. Now in the active Script itself you simply do this DTSDestination("Column Name") = DTSGlobalVariables("Retrieved Filename").Value When you come back to the trasnformations tab you should see a transform starting over the top of the source columns i.e. not attached and the destination is your destination column. Hi. I have a dts package that loads data from a fixed length text file into [quoted text clipped - 10 lines] -Terry |
![]() |
| Thread Tools | |
| Display Modes | |
| |