Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 HOWDOI??Importing from dynamic filename

Author  Topic 

maxjam
Starting Member

9 Posts

Posted - 2007-02-06 : 12:01:11
Hi all,

ive a dts package which currently imports data from a text file.

Ive got a TextFile Source connection
a Transform Data Task
a SQL Server Destination connection

This works fine as long as i go in and manually reset the Textfile source filename but very soon I will have to set this up to manually import from a file which will change each day, eg
ABCDEF02_FFF99_20072603.txt
ABCDEF02_FFF99_20072604.txt
ABCDEF02_FFF99_20072605.txt

I was going to load the first part of the file name into a table as this would allow someone to change it (a necessity) every couple of months, then use DTS dynamic properties to create a file name using a SQL query eg:

SELECT RTRIM(FileName) + CONVERT(VARCHAR(8), GETDATE(), 112) + '.txt' FROM ztblCBSICBSourceFileNameTable

However once I add the Dynamic property, how do i tell the text source file to use the dynamic property as its filename? it doesnt seem to pick it up!????

Is there a more obvious and easier way to approach this problem?

Thanks in advance.

Max
   

- Advertisement -