December 17, 2006 at 10:02 pm
Hi,
I need to import a great number of text files into database. I am thinking about creating a dts package and using it with file name as a parameter. Is there a way to pass a parameter to a DTS package? If not is there a possibility to script a DTS package so to be able to create it dynamicaly, then run it and then drop it and recreate it again with different text file as a source? If all this is not possible, what other options exist?
Thanks.
December 18, 2006 at 3:46 am
You create a global variable "ImportFileName".
Then in your call to dtsrun you add the following parameter:
dtsrun .... /A "ImportFileName":8=C:\MyFolder\MyFile.txt"
Then you use a Dynamic Properties task to set the DataSource property of the text connection.
Russel Loski, MCSE Business Intelligence, Data Platform
December 18, 2006 at 2:19 pm
If the list of files is in a table you could build a DTS loop to import all of the files. If you want to import all of the files in a directory you can do it like this:
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy