dbTalk Databases Forums  

Create Global variable from striped file name

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Create Global variable from striped file name in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom DBD
 
Posts: n/a

Default Create Global variable from striped file name - 06-14-2006 , 04:01 PM






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?


Reply With Quote
  #2  
Old   
UnderCover
 
Posts: n/a

Default RE: Create Global variable from striped file name - 06-14-2006 , 07:56 PM






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:

Quote:
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?


Reply With Quote
  #3  
Old   
Tom DBD
 
Posts: n/a

Default RE: Create Global variable from striped file name - 06-15-2006 , 12:23 PM



UnderCover thanks, I actually look at the solution you suggested for looping.
I using that import the text file.

thanks again
Tom DBD



"UnderCover" wrote:

Quote:
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?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.