时间:2021-07-01 10:21:17 帮助过:3人阅读
还原:
declare @db_name varchar(100) set @db_name = ‘WSS_Content_Test‘; declare @db_location varchar(100) set @db_location = ‘D:\spbr0002\0000000B.bak‘; --保证有此文件夹 if exists(select * from master..sysdatabases where has_dbAccess(name)=1 and name=@db_name) begin alter database WSS_Content_Test set single_user with rollback immediate end restore database WSS_Content_Test from disk = @db_location with stats=5,file=1,replace,norewind,nounload,recovery;
SQL Server 备份和还原数据库
标签: