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)
 vbscript in DTS package

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-11-25 : 06:58:19
jeels writes "hi all,
I have a DTS job running which creates a text file....
once the text file is created i need to append the current date time stamp in the text file to the existing data in the text file Using VB script.

Using VB script I also need to rename an existing .sql file with the current date stamp
i mean for example if i have a data.sql
i need to rename it as 11202002data.sql

I hope u have understood my problem....

any help is realluy appreciated.
Thanx in advance,
Jeels"

nr
SQLTeam MVY

12543 Posts

Posted - 2002-11-25 : 07:25:20
Append
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objF = objFso.GetFile(strName)
Set objFile = objF.OpenAsTextStream(8)
objFile .WriteLine strText
objFile .Close
set objFile = nothing
set objF = Nothing
set objFso = nothing

rename
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objF = objFso.GetFile(strName)
objF.Move(strNewName)
set objF = Nothing
set objFso = nothing


==========================================
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 -