一、备份数据库,命令如下:
USE master;
GO
BACKUP DATABASE mytest TO DISK='E:diskmytest.bak' /* mytest为数据库名称,'E:diskmytest.bak'为备份路径 */
二、还原数据库
RESTORE DATABASE mytest FROM DISK='E:diskmytest.bak' WITH REPLACE