用命令实现SQLServerr的备份与还原

一、备份数据库,命令如下:

  USE master;

  GO

  BACKUP DATABASE mytest TO DISK='E:\disk\mytest.bak' /* mytest为数据库名称,'E:\disk\mytest.bak'为备份路径 */


二、还原数据库

  USE master;

  GO

  RESTORE DATABASE mytest FROM DISK='E:\disk\mytest.bak' WITH REPLACE

posted @ 2016-06-14 10:05  jefflee168  阅读(293)  评论(0编辑  收藏  举报