Home  >  Article  >  Database  >  简单的对SqlServer数据库备份文件设置密码!

简单的对SqlServer数据库备份文件设置密码!

WBOY
WBOYOriginal
2016-06-07 17:48:281094browse

方法很简单,只要几句主可以实现设置密码了,有需要的朋友参考一下

备份SqlServer

 代码如下 复制代码
Backup Database [数据库] To disk='c:'+ replace(replace(replace(replace(CONVERT(varchar, getdate(), 121),'-',''),' ',''),':',''),'.','') +'.bak' With Password = '123',init;

恢复SqlServer数据库

 代码如下 复制代码
Restore Database [数据库] From disk=数据库备份文件地址 With Password = '123';
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn