日期:2014-05-18 浏览次数:20449 次
SELECT * from master.dbo.sysprocesses WHERE DBid=db_id('Test')
------解决方案--------------------
select * from master..sysprocesses where db_name(dbid)= 'master'
------解决方案--------------------
要斷連接用Kill declare @spid int select @spid=spid from master.dbo.sysprocesses WHERE DBid=db_id('Test') exec('kill '+ @spid)
------解决方案--------------------
if exists(select 1 from master..sysprocesses where DBid=db_id('xx')) ...