DTS package with a parameter

  • 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.

  • 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

  • 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:

     

    http://www.sqldts.com/default.aspx?246


Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply