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 from a BAT file

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2005-04-29 : 05:56:08
Hi how can I backup a SQL server 7 database to C:\DATA\ using a batch file ....

thank you

nr
SQLTeam MVY

12543 Posts

Posted - 2005-04-29 : 06:36:49
Use osql to run a backup command.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2005-04-29 : 08:30:58
thanks, I now have this :
OSQL -Usa -P -n -Q "BACKUP DATABASE [MSDB] TO DISK = 'C:\TEST.BAK'"

how can I run it and every new backup will add the date and time to the backup name... is this possible ?

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-04-30 : 10:07:28
I would create a Stored Procedure, which manipulates the File name etc., and then execute that from OSQL

krsiten
Go to Top of Page
   

- Advertisement -