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)
 CSV File with Date Stamp

Author  Topic 

SQLCode
Posting Yak Master

143 Posts

Posted - 2004-12-14 : 11:40:19
Hi,
I have a package which creates a csv file. I need the datestamp on the name. For example MyFile_MM-DD-YY.csv or something similar.
On this forum I saw some examples that would do it with VB Script.
I do not know how to implement the VB script in the package.

I have the source and destination, transformations etc., in the package.

How would I solve my problem and how would I implement any functions if I have to.

Please help.

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-14 : 12:11:28
Easier to create the file using bcp.
You could rename the file after creating it in the package too.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

SQLCode
Posting Yak Master

143 Posts

Posted - 2004-12-14 : 12:22:50
Nigel,
How would I do it in the package. If it is with a function, I do not know how to use functions in DTS. I saw your replies in earlier(similar) question.
Could you please tell me how?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-14 : 21:06:22
You could create a sql task

declare @cmd varchar(1000)
select @cmd = 'ren c\mypath\myfile.txt myfile_' + convert(varchar(8),getdate(),112) + '.txt'
exec master..xp_cmdshell @cmd

or something like that.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -