Hi
My SQL script needs to copy all backup files in a folder to another one while renaming them at the same time by adding the time stamp like this: Originalfilename[Timestamp].bak
Basically the script looks like this:
declare@cmdstringvarchar(1000)
declare@filenamestrvarchar(100)
set@filenamestr= CURRENT_TIMESTAMP
set@cmdstring= 'copy \\Webserver\BackupStorage\SQLbackup\*.* \\Webserver\BackupStorage\SQLbackupArchive\'
execmaster..xp_cmdshell@cmdstring – this part is not complete
What code needs to be added to rename each file during the copy process?
Patrick