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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-08-06 : 08:03:28
|
| Fred writes "What is the easiest way to append a timestamp to a (destination)textfile filename to make it unique using DTS?" |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-08-06 : 13:57:14
|
| Add ActiveX Script Task (with the script shown below) as the veryfirst step of your package with 'On Success' workflow from it.Function Main()dim p, c, f, nset f=createobject("scripting.filesystemobject")n="D:\new" & _formatdatetime(date) & timer & ".txt"f.createtextfile nset p=dtsglobalvariables.parentset c=p.connections("Text File (Destination)")c.datasource=n 'here we change Destination File FullName' to the just now created text file with unique(?) name... Main = DTSTaskExecResult_SuccessEnd Function- Vit |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-08-06 : 13:57:35
|
| You could use osql to do this.osql -Sserver1 -Uuser1 -Psomepassword -q"SELECT GETDATE()" >>C:\Temp\YourFile.txtosql is a command line utility. It can be used inside your DTS package in the "Execute SQL Task" task. Two > mean to append, one means create a new file.Tara |
 |
|
|
|
|
|