Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Job to create a folder and copy a file 1

Status
Not open for further replies.

TMRO

Technical User
Jan 10, 2003
140
CA
Hi,

I need to create a job in SQL 2000 that will copy a specified file in a specified directory. If that directory doens't exist then it should create it.

Is this possible in SQL?

Thanks,
TMRO
 
Hi,
You will have to use an ActiveX programming in a DTS that uses File system object:


Dim objFSO, objFile, objFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("D:\Data\LOG\SendLog\")


For Each objFile in objFolder.Files


objFile.move "D:\Data\LOG\SendLog\Test\"



Jean-Paul
Montreal
To send me E-Mail, remove “USELESSCODE”.
jp@USELESSCODEsolutionsvba.com
 
Glad I could help.

Jean-Paul
Montreal
To send me E-Mail, remove “USELESSCODE”.
jp@USELESSCODEsolutionsvba.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top