数据库全量备份
BACKUP DATABASE [数据库名]
TO DISK = N'备份路径.bak'
WITH NOFORMAT
, NOINIT
, NAME = N'数据库名'
, SKIP
, REWIND
, NOUNLOAD
, STATS = 10
数据库全量还原
.用SQL语句的方法(假设你的备份文件名为: c:\xx.bak
--列出备份文件中的逻辑文件名
restore filelistonly from disk='c:\xx.bak'
--用语句恢复,根据上面列出的逻辑文件名使用move选项
restore database 恢复后的数据库名
from disk='c:\xx.bak'
with move '逻辑数据文件名1' to 'c:\物理数据文件名1'
,move '逻辑数据文件名2' to 'c:\物理数据文件名2'
...
,move '逻辑数据文件名n' to 'c:\物理数据文件名n'
restore database [数据库名]
from disk='还原路径'
WITH FILE = 1,
NOUNLOAD ,
STATS = 10,
RECOVERY ,
REPLACE ,
move 'DownloadFile' to 'D:\DownLoadFile.mdf'
,move 'DownloadFile_log' to 'D:\DownLoadFile_1.ldf'