This query should be executed in Master Database(System Database)...
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'
GO
kill sp_id
exec sp_dboption 'db_Name', 'single user', 'FALSE'
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'
GO
kill sp_id
exec sp_dboption 'db_Name', 'single user', 'FALSE'
No comments:
Post a Comment