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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-01 : 07:35:42
|
| Sandra writes "For my Backup/Recovery strategy I´m using the follwing script:Declare backup_dbs Cursor For Select name from sysdatabases where dbid > 6 order by nameopen backup_dbs-- Variable für das SicherungsmediumDeclare @dbname sysnameFetch next from backup_dbs into @dbnamewhile (@@Fetch_Status = 0) begin print 'Backup der Datenbanken ' +@dbname-- Backup der aktuellen Datenbank exec ('Backup database ' +@dbname+ ' toDISK=''d:\Programme\Microsoft SQL Server\MSSQL\BACKUP\Montag\'+@dbname+'.bak with init''') Fetch next from backup_dbs into @dbname EndClose backup_dbsDeallocate backup_dbsThis runs fine with one exception, instead of performing "with init" it adds with init to the backup file name. I tried several days to get it to work, but I didn´t succeed. What did I wrong ?Any help is highly appreciated." |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-06-01 : 07:56:11
|
| exec ('Backup database ' +@dbname+ ' toDISK=''d:\Programme\Microsoft SQL Server\MSSQL\BACKUP\Montag\'+@dbname+'.bak'' with init') |
 |
|
|
|
|
|