dbTalk Databases Forums  

importing files wit a date in their name

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss importing files wit a date in their name in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jason
 
Posts: n/a

Default importing files wit a date in their name - 12-14-2004 , 03:02 AM






Hi,

How can i import multiple files in sql server 2000 by using a dts package?

The dts package should import files with the most current date. The date can
be found in the name, e.g.: <companyname>_20041214.mdb.

Also i would like to use the companyname from the filename to fill in a
empty column, so i can import all files into one normalized table.

The files are placed in on a root drive.

If someone can help me on this i would be very happy.

Thnx.

J



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: importing files wit a date in their name - 12-14-2004 , 07:26 AM






I would use an ActiveX Script Task to derive the filename, e.g.

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

I assume the coimpany name changes, so this shoudl be a global variable. As
such it can of course be used in the ActiveX Script Task to build the
filename and also in a an ActiveX Script Tasnform to assign the value to a
destination column, e.g.

Function Main()
DTSDestination("DestCol").Value =
DTSGlobalVariables("CompanynameVar").Value
Main = DTSTransformStat_OK
End Function


--
Darren Green
http://www.sqldts.com


"Jason" <jasonlewis (AT) hotrmail (DOT) com> wrote

Quote:
Hi,

How can i import multiple files in sql server 2000 by using a dts package?

The dts package should import files with the most current date. The date
can
be found in the name, e.g.: <companyname>_20041214.mdb.

Also i would like to use the companyname from the filename to fill in a
empty column, so i can import all files into one normalized table.

The files are placed in on a root drive.

If someone can help me on this i would be very happy.

Thnx.

J





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.