一般的情况下我们会选用SQLServer自带的数据库维护计划来定义备份.
但有些时候,有的机器数据库维护计划不能成功实现备份.
错误原因可能不尽相同,这时我们可以用简单的SQLServer备份脚本来做备份.
生成简单的SQLServer备份脚本的SQL语句:
usemaster
select'backupdatabase'+name+'todisk=''F:\sqlserver_backup\'+name+'.bak''withinit'fromsysdatabases
-------------------------------------------------------------------------------------------------
backupdatabasemastertodisk='F:\sqlserver_backup\master.bak'withinit
backupdatabasemodeltodisk='F:\sqlserver_backup\model.bak'withinit
backupdatabasemsdbtodisk='F:\sqlserver_backup\msdb.bak'withinit
backupdatabasedb_app1todisk='F:\sqlserver_backup\db_app1.bak'withinit
backupdatabasedb_app2todisk=F:\sqlserver_backup\db_app2.bak'withinit