还原SQL server失败导致单个用户

https://jingyan.baidu.com/article/20095761ca8343cb0721b4fb.html

还原SQL server失败导致单个用户问题:

 

1 DECLARE @SQL VARCHAR(MAX); 
2 SET @SQL='' 
3 SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID) 
4 FROM master..sysprocesses 
5 WHERE dbid=DB_ID('DEV_SMM_LB'); 
6 EXEC(@SQL);
7 ALTER DATABASE DEV_SMM_LB SET MULTI_USER

 

posted @ 2018-09-06 15:06  dotdotdog  阅读(206)  评论(0编辑  收藏  举报