Home All Groups Group Topic Archive Search About
Author
27 May 2005 8:04 PM
Bob Castleman
I'm writing a proc to do tlog backups. I want to validate the path before
attempting to issue the backup command but I don't see any documented file
handling funtions in T-SQL. What's the best approach for this?

Thanks,

Bob Castleman
DBA Poseur

Author
27 May 2005 8:36 PM
JT
Implement a DTS package that first uses the FSO.FileExists function via a
ActiveX Script task to verify the folder. If the task returns success, then
use a Execute SQL task to call your SP.

Function Main()

Main = DTSTaskExecResult_Failure

sCopyFrom = "c:\temp\xxx.tmp"

sCopyTo = "c:\temp\xxx.dat"

set FSO = CreateObject("Scripting.FileSystemObject")

if not FSO.FileExists( sCopyFrom ) then
  exit function
end if

if FSO.FileExists( sCopyTo ) then
  FSO.DeleteFile sCopyTo
end if

FSO.CopyFile sCopyFrom, sCopyTo

set FSO = nothing

Main = DTSTaskExecResult_Success

End Function

Show quoteHide quote
"Bob Castleman" <nomail@here> wrote in message
news:e180EavYFHA.1028@TK2MSFTNGP10.phx.gbl...
> I'm writing a proc to do tlog backups. I want to validate the path before
> attempting to issue the backup command but I don't see any documented file
> handling funtions in T-SQL. What's the best approach for this?
>
> Thanks,
>
> Bob Castleman
> DBA Poseur
>
>

Bookmark and Share