Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jholovacs
Posting Yak Master
163 Posts |
Posted - 2009-07-14 : 11:23:25
|
I'm trying to do maintenance on a database where a bunch of developers and applications with a bunch of different credentials are connecting to it all the time, and this interferes with the work I'm doing. So I stick it into single user mode, I'm about to start... and someone's already taken the connection! Now I can't even see who has it because the Activity monitor can't access the database.How do I find out who's in the database, kick his butt out, and inject myself so nobody else can get in? SELECT TOP 1 w.[name]FROM dbo.women wINNER JOIN dbo.inlaws i ON i.inlaw_id = w.parent_idWHERE i.net_worth > 10000000 AND i.status IN ('dead', 'dying') AND w.husband_id IS NULLORDER BY w.hotness_factor DESC |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
jholovacs
Posting Yak Master
163 Posts |
Posted - 2009-07-14 : 12:58:50
|
meh... that requires me to use SQLCMD. I want to make a connection to the database in Management Studio so I can query and run procs as needed. SELECT TOP 1 w.[name]FROM dbo.women wINNER JOIN dbo.inlaws i ON i.inlaw_id = w.parent_idWHERE i.net_worth > 10000000 AND i.status IN ('dead', 'dying') AND w.husband_id IS NULLORDER BY w.hotness_factor DESC |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-07-14 : 14:30:17
|
should use restricted_user instead of single_user |
 |
|
|
|
|