SQL Server 简单备份脚本入门实例

前端之家收集整理的这篇文章主要介绍了SQL Server 简单备份脚本入门实例前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

生成简单的sql Server备份脚本的sql语句(运行下面语句):   

use master 
select 'backup database '+name+' to disk=''F:\sqlserver_backup\'+name+'.bak'' with init' from sysdatabases ;

生成备份脚本如下:   

sql代码如下:

backup database master to disk='F:\sqlserver_backup\master.bak' with init 

backup database model to disk='F:\sqlserver_backup\model.bak' with init 

backup database msdb to disk='F:\sqlserver_backup\msdb.bak' with init 

backup database db_app1 to disk='F:\sqlserver_backup\db_app1.bak' with init 

backup database db_app2 to disk=F:\sqlserver_backup\db_app2.bak' with init

---- 来自jb51.cc 
原文链接:https://www.f2er.com/mssql/530200.html

猜你在找的MsSQL相关文章