dbTalk Databases Forums  

Unique destination file name

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


Discuss Unique destination file name in the microsoft.public.sqlserver.dts forum.



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

Default Unique destination file name - 08-02-2006 , 03:12 PM






Hi, Is there any way to give the destination file a new file name (i.e. one
based on current date/time) in the DTS package or is it best to just write a
DOS batch file to copy the file to a new filename after the package is run?
Thanks!

Reply With Quote
  #2  
Old   
Norman Kelm
 
Posts: n/a

Default Re: Unique destination file name - 08-02-2006 , 08:02 PM






Diana,

One way to handle this would be to set the destination file name via a
global variable and a dynamic properties task. Then in the job step use
the command tokens to set the date and time.
DTSRun /S "(local)" /N "Pkg11" /A
TargetFile":"8"="[DATE][TIME]Results.txt" /W "0" /E

See the BOL for sp_add_jobstep and go to the @command parameter. All the
tokens are defined there.

Another way would be to build the time string in an activex script task,
assign it to a global variable and then assign the file name with a
dynamic properties task.

Norman

get DTS Package Search at http://www.gerasus.com/

Diana_R wrote:
Quote:
Hi, Is there any way to give the destination file a new file name (i.e. one
based on current date/time) in the DTS package or is it best to just write a
DOS batch file to copy the file to a new filename after the package is run?
Thanks!

Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Unique destination file name - 08-03-2006 , 05:54 AM



What about using something like in this article

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



--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



"Diana_R" <DianaR (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi, Is there any way to give the destination file a new file name (i.e.
one
based on current date/time) in the DTS package or is it best to just write
a
DOS batch file to copy the file to a new filename after the package is
run?
Thanks!



Reply With Quote
  #4  
Old   
Diana_R
 
Posts: n/a

Default Re: Unique destination file name - 08-03-2006 , 10:39 AM



Hi Norman and Allan,
Thanks for your responses. I tried something similar to what Norman
suggested yesterday afternoon and it seems to be working the way I'd like.
Kindest regards,
Diana

"Allan Mitchell" wrote:

Quote:
What about using something like in this article

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



--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



"Diana_R" <DianaR (AT) discussions (DOT) microsoft.com> wrote in message
news:CA10FA08-2062-43DB-9BF5-995DC5D0C3E4 (AT) microsoft (DOT) com...
Hi, Is there any way to give the destination file a new file name (i.e.
one
based on current date/time) in the DTS package or is it best to just write
a
DOS batch file to copy the file to a new filename after the package is
run?
Thanks!




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.