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-07-08 : 11:58:25
|
| Daniel writes "If I run a backup from OSQL using the backup database dbname to disk = "X:\dbbackup.bak"I get a nice little backup file just where it should be, the correct size and everything.If I run the same command again, MSDE will backup the database to the same name and location but if I look at the size of the backup file it has noe DOUBLED in size. My first question is why is MSDE not overwriting the previous backup file?Second question is how do I get MSDE to backup the database with a date and time for a file name?Third question is what happens if I try to restore from that huge backup file?Forth question is has anyone else seen anything like this before?" |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-08 : 13:22:32
|
| Use WITH INIT option on your backup script.BACKUP DATABASE whateverTO DISK = '\\server\share\directory\whatever.bak'WITH INITSecond Question:SELECT @filename = '\\server\share\directory\whatever_' + CONVERT(VARCHAR,GETDATE(),112) + '.bak'BACKUP DATABASE whateverTO DISK = '\\server\share\directory\whatever.bak'WITH INITThird Question:If you try to restore from it, you will need to choose which backup to actually restore.Fourth Question:Of course.Fifth question (How do I do this right?):Look at Tara's blog for the right way to do it. http://weblogs.sqlteam.com/taradMeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-08 : 13:44:31
|
Daniel, Mean Old DBA is getting older! :Second Question:DECLARE @filename nvarchar(256)SELECT @filename = '\\server\share\directory\whatever_' + CONVERT(VARCHAR,GETDATE(),112) + '.bak'BACKUP DATABASE whateverTO DISK = @filenameWITH INIT Kristen |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-08 : 23:49:03
|
| lol WOW!!! I definitely need a vacation.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-09 : 08:11:59
|
| I think you need BossForum or WifeForum for that one!Kristen |
 |
|
|
|
|
|