dbTalk Databases Forums  

DTS File Name

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


Discuss DTS File Name in the microsoft.public.sqlserver.dts forum.



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

Default DTS File Name - 11-04-2003 , 08:45 PM






I need to DTS a text file that is placed up on our
network and named file.daily.20031104 (today's date) How
do I get DTS to grad that file since everyday it has a
different name? Someone told me to set up a stored proc
that renames that file first...then let DTS grab it, then
rename it back to the original name and then archieve it.
Any ideas?? Thanks!

Reply With Quote
  #2  
Old   
Rich London
 
Posts: n/a

Default DTS File Name - 11-04-2003 , 10:15 PM






I am not 100% sure, but I would do it this way -

1. Create a GlobaVariable FileName of type string.
2. Create a ActiveX task that actually updates this Global
Variable to the right filename ie. file.daily. + getdate().
3. Create a Connection object (e.g C1) to the Text File,
and the connection properties could be updated easily.

Dim oConn
Set oConn = DTSGlobalVariables.Parent.Connection("C1")
oConn.DataSource = CONCATINATED STRING (file.daily. +
getdate()

I think this should do it.



Quote:
-----Original Message-----
I need to DTS a text file that is placed up on our
network and named file.daily.20031104 (today's date) How
do I get DTS to grad that file since everyday it has a
different name? Someone told me to set up a stored proc
that renames that file first...then let DTS grab it, then
rename it back to the original name and then archieve it.
Any ideas?? Thanks!
.


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

Default Re: DTS File Name - 11-05-2003 , 12:42 PM



In article <062901c3a353$77e53930$a501280a (AT) phx (DOT) gbl>, Rich London
<anonymous (AT) discussions (DOT) microsoft.com> writes
Quote:
I am not 100% sure, but I would do it this way -

1. Create a GlobaVariable FileName of type string.
2. Create a ActiveX task that actually updates this Global
Variable to the right filename ie. file.daily. + getdate().
3. Create a Connection object (e.g C1) to the Text File,
and the connection properties could be updated easily.

Dim oConn
Set oConn = DTSGlobalVariables.Parent.Connection("C1")
oConn.DataSource = CONCATINATED STRING (file.daily. +
getdate()

I think this should do it.

I'd say the would do it. For a full code example see-

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

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.