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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Backup Database w/ Overwrite

Author  Topic 

Adrenaline Seed
Starting Member

10 Posts

Posted - 2009-02-18 : 19:21:03
Wow, I figured I could answer this super quick with a google search, NOTHING. Can anyone tell me how to improve this command by letting it know to overwrite in case there is already a backup file there with the same name.

BACKUP DATABASE foo TO DISK = 'c:\program files\microsoft sql server\mssql\location\filename.bak'

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-18 : 19:33:58
SQL Server Books Online is your friend for this type of thing.

BACKUP DATABASE foo
TO DISK = 'c:\program files\microsoft sql server\mssql\location\filename.bak'
WITH INIT

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Adrenaline Seed
Starting Member

10 Posts

Posted - 2009-02-19 : 11:58:03
Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-19 : 12:30:57
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -