Determining default db

  • I have a user who's in 2 domain groups.  Each group has login permissions and has a different default database.  When the user logs in without specifying a database how is the default database determined?

    Also if one of the databases is made unavailable(dbo only) does this prevent access to the other database?

  • 1)The default database is set by login. See sp_defaultdb in the books online.

    Not sure if they can still login when the default database is offline.

    (can somebody confirm or correct this?)

    2)They should be able to use the other database.

    I'm used to set the default database to master (always present)

    and addressing the objects with their full reference database.owner.objectname

  • You can check this easily in EM.  Just open Security/Logins, right click the user of interest and select properties and you will see the default database.


  • Maybe I'm not being clear.   My situation is where you have a domain account(A1) that is in 2 domain groups(G1 and G2).  Each of these groups(not the domain account) has login permission and each group has a different default database - G1 to DB1 and G2 to DB2.  When A1 connects to the server without specifying a database, which database is A1 connected to?

  • I believe that it defaults to the domain group (which has a defauilt database specified) which is first in the collation sequence of domain\group.

     

    Now for the issue of one database being 'unavailable' ... well in theory, one set of database  permissions should have no affect on another set of database permissions in a different database since they are stored locally within their respective databases. Now whether you end up in the second 'default database' or the master database I do not know.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply