728x90

select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame
from sysprocesses p
inner join sysdatabases d on p.dbid = d.dbid
where d.name = 'DB_Name'

 

or

 

exec sp_who2

kill spid

alter database DB_Name set multi_user;

alter database DB_Name set sigle_user;

728x90

+ Recent posts