![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, My first post here. first I'll explain what I have, then I'll explain what I want to do I have a package that 1. Deletes all data from a holding table. 2. imports a cvs text source file (holds monthly data) as is from a network directory to re-populate the holding table (all column varchar(255) 3. Delete data from production table based on month and year 4. transform data (dates, int, etc) and insert into production table from holding table. Each month I have to change my text source to point to the new file and re-map my Copy column transformation. I then change my SQL task to delete the proper month and year (I know how to use Global Vars once created) What I want to do: The cvs file is named with the year-month in the file name (example: 0605myFile.csv contains May 2006 data.) I want my package to find the csv file (only 1 file in network dir\folder), strip the month and year and pass into global vars, set the found file as the text souce and re-map column copy to holding table. My goal, once I can figure out a soultion for above, is to to have the package execute using the dtsrun utility. Does this make sense or Is this possible? |
#3
| |||
| |||
|
|
With out writing it for you what you need to do is use an activeX script to write the logic of how to determine the name of the file and then pass it to a global variable. You can also set the file as the text source using Active X and dynamic properties task together. The same goes for remap of the columns. This will get you started http://www.sqldts.com/default.aspx?200 "Tom DBD" wrote: Hello, My first post here. first I'll explain what I have, then I'll explain what I want to do I have a package that 1. Deletes all data from a holding table. 2. imports a cvs text source file (holds monthly data) as is from a network directory to re-populate the holding table (all column varchar(255) 3. Delete data from production table based on month and year 4. transform data (dates, int, etc) and insert into production table from holding table. Each month I have to change my text source to point to the new file and re-map my Copy column transformation. I then change my SQL task to delete the proper month and year (I know how to use Global Vars once created) What I want to do: The cvs file is named with the year-month in the file name (example: 0605myFile.csv contains May 2006 data.) I want my package to find the csv file (only 1 file in network dir\folder), strip the month and year and pass into global vars, set the found file as the text souce and re-map column copy to holding table. My goal, once I can figure out a soultion for above, is to to have the package execute using the dtsrun utility. Does this make sense or Is this possible? |
![]() |
| Thread Tools | |
| Display Modes | |
| |