常常需要 restore database
但一旦有人連在線上,就必需先 kill procId
砍也砍不完
正確的 sql script 應如下
alter database DbName
Set Single_Userwith rollback immediate
use master
RESTORE DATABASE [DbName] FROM DISK = N'c:\folder1\db.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10, restricted_user
alter database DbName Set Multi_User
沒有留言:
張貼留言