Replacing a string with timestamp
Posted: 15 Mar 2011 08:18
I'm using this string to backup via comand line (SQLCMD) a db on sql.
BACKUP DATABASE [NameDB] TO DISK = N'c:\SqlDB\NameDB.bak' WITH NOFORMAT, NOINIT, NAME = N'NameDB-Full DB Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
I wish, through windows "Scheduled task", run daily backups.
Obviously the file would be overwritten.
Is it possible to scan the string with a batch file, searching the filename and appending it with a time stamp?
example NameDB.bak becomes NameDBYYYYmmddhhmm.bak (NameDB201103151400.bak )
NibbioTNT
thx
BACKUP DATABASE [NameDB] TO DISK = N'c:\SqlDB\NameDB.bak' WITH NOFORMAT, NOINIT, NAME = N'NameDB-Full DB Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
I wish, through windows "Scheduled task", run daily backups.
Obviously the file would be overwritten.
Is it possible to scan the string with a batch file, searching the filename and appending it with a time stamp?
example NameDB.bak becomes NameDBYYYYmmddhhmm.bak (NameDB201103151400.bak )
NibbioTNT
thx