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.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 How to check the sessions in SSMS

Author  Topic 

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 10:04:32
I have a few databases listed in SSMS, how can I tell who is currently connecting to which database, and how can I terminate a session in SSMS?

Thanks,
Sharon

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 10:05:49
Have a look at SP_WHO2 and KILL.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 10:17:35
THanks.

I tried to take a database offline. Now I can't logon to SSMS as it is my default database. How can I fix this now?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 10:49:06
In the dialog to connect you can click OPTIONS and there you can select another database for the connection.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 10:53:02
Browsing the available databases requires to connect to the server first, and I am not allowed to connect the server since my default database can't be opened(offline).
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 11:01:57
In the first screen type in your login data as usual then it is ok to browse the available databases.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 11:04:16
Also it is possible to type in the databasename instead of browsing but for this you have to know the name of a database on that server.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 11:12:58
Thanks, I typed mater database and I seemed able to logon SSMS(but keeps giving me error: can not open default database).

Now the question is, how can I change my default database?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 11:25:03
See here for example on how to change the default database for a user:
http://geekswithblogs.net/.NETonMyMind/archive/2008/01/19/118692.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 11:25:19
Ignore my last question, I have figured out how to do it.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 11:26:36
16 secs too fast to ignore


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sharon911
Starting Member

46 Posts

Posted - 2010-04-26 : 13:44:54
[quote]Originally posted by webfred

16 secs too fast to ignore

Thanks so much for your quick reply
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-26 : 13:46:25
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -