sqlserver2005 单个用户更改为多用户

sqlserver 里用了复制数据库的功能,失败后,数据库变为(单个用户)连接不上,搜索到如下解决办法,成功恢复

declare @kid varchar(8000)
set @kid=''
select @kid=@kid+' kill '+cast(spid as varchar(8))
from master..sysprocesses
where dbid=db_id('db_GPS')
Exec(@kid)

ALTER DATABASE db_GPS SET MULTI_USER;

你可能感兴趣的:(sqlserver,2005,单个用户)