Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Default Database Expand / Collapse
Author
Message
Posted Tuesday, November 10, 2009 10:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 17, 2012 1:26 PM
Points: 2, Visits: 43
How do you know which is your default database for your server?
Post #816688
Posted Tuesday, November 10, 2009 11:22 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 7:18 AM
Points: 130, Visits: 362
sp_helplogins should tell you this, look in the DefDBName, but will require elevated priviliges to run. Otherwise you can go to a database the user has been added to and run:

sp_helpuser 'UserAccountHere'
Post #816698
Posted Tuesday, November 10, 2009 11:29 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 20, 2014 8:20 AM
Points: 110, Visits: 375
sp_helplogins 'your loginame' would give you the default database name along with other info ...... If you are just looking for login name and default database .... you could run this

select [name],dbname from sys.syslogins


-------------------------------------------------
-Amit
Give a man a fish and he'll ask for a lemon. Teach a man to fish and he wont get paged on weekends !! - desparately trying to fish
Post #816704
Posted Tuesday, November 10, 2009 2:11 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 17, 2012 1:26 PM
Points: 2, Visits: 43
Thay you two for the replies. That's exactly what i needed.
Post #816831
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse