October 14, 2003 at 1:05 am
Hi Experts,
CSV file to Sqlserver 2000 sp3a Loading
I want to run DTS thru Sql server agent with cvs file name input. Multiple input files of same structure are coming from different locations.I am planning to input file name in same DTS to load one particular location file. It will be great if anybody can suggest alternative ways of doing the same.
Thanks,
Sheilesh
October 14, 2003 at 9:45 am
Set up a DTS package with 2 steps
Step1 DTS Files to master table
Step2 DTS contents of table to new target file.
Set up a job to run the package.
October 15, 2003 at 12:20 am
Hi sqlSushi,
Thanks for the reply.
I am not getting your steps
Step1 DTS Files to master table
what are DTS files and what is master table here ?
Step2 DTS contents of table to new target file.
not clear
Can we write steps in Import wizard also or will need to go in new package and design manually ?
October 15, 2003 at 1:50 am
Have a look at the DTS package at the link below:
http://www.sqldts.com/default.aspx?t=6&s=103&i=246&p=1&a=0
It shows how to loop around a package reading files from a directory, whilst not quite want you are trying to achieve, it could be easily modified so that instead of using all files in a given directory, it could use files in a specified location.
October 15, 2003 at 6:35 pm
I've got a really simple package that does this. As long as the structure and destination of the files is constant all you have to do is change the "Text File (Source)" Data Source.
To do this you need a package with a text file data source already defined (Called "Text File (Source)" as default)
1) Create String Global Variable called csvFile as set it to the file path of the csv (this can be dynamic)
2) Create a new "Dynamic Properties Task"
A) Under this task click Add
B) drill down to "Connections/Text File (Source)/OLE DB Properties/Data Source"
C) Double click below "Default Value"
D) In the "Add/Edit Assignment" window change "Source" to Global Variable, then choose csvFile as the variable.
Now, when you run this it changes the Text file source from one file to another. You get my drift...it's pretty easy to implement. Email me at clawson@vestcom.com if you want me to send you a DTS package that does this (and also has a loop in it)
Signature is NULL
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply