variable for data source file

  • I have a folder with several subfolders with many files (.csv) in each subfolder.  All files in each subfolder can be categorized in 3 different types of files where the first part of the file name (prefix) is different for each file but the ending of the file name is one of the 3 categories (e.g. prefix & “endName1”, prefix & “endName2”, prefix & “endName3”).  The category that each file belongs to is significant because each category of files has its own type of DTS package with its own type of transformations.  The data in files needs to be transferred and transformed to tables on SQL server database.

     

    I have written a VB code that goes through the folder and then through each subfolder and then through each file and, depending on the file endName (meaning category) will run the appropriate DTS package for that category of file.  The problem is that the DTS package has the Data Source File already set up for one file name (first file I used to setup the DTS package) and it needs to be a variable so that it can make the Data Source File whatever the current file selected is.

     

    Can you set this variable within the DTS package or should I not even use the DTS packages and set up data transfer and transformation in VB and run everything from VB since the code is in an Access db and the execute command will be in Access GUI?  I looked through the DTS info but was not able to find any info on the topic.  Any suggestions?

    Thanks,

  • Yep, you can at runtime change the filename

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

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

  • Thanks Ray, I'll try it.

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

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