Hello!
I have a question about default databases and Windows groups. A Windows
login is a member of two Windows groups. These two Windows groups have been
granted access to a sql server.
Login1 Member of Group1 and Group2
Group1 DefaultDbA
Group2 DefaultDbB
How is the default database determined if Login1 is connecting to the sql
server?
Best regards
Ola HallengrenThis is, to the best of my knowledge, not deterministic. There is not settin
g for this. So, it could
go either way. IMO, an app should never depend on default database - it shou
ld set the database in
the connection string. You could, of course, add Login! as a login to SQL Se
rver and specify the
default database for that login (I'm pretty certain that this would be honor
ed).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ola Hallengren" <OlaHallengren@.discussions.microsoft.com> wrote in message
news:5A8547EF-89D3-4BE0-BD3F-AD1899F40F0B@.microsoft.com...
> Hello!
> I have a question about default databases and Windows groups. A Windows
> login is a member of two Windows groups. These two Windows groups have bee
n
> granted access to a sql server.
> Login1 Member of Group1 and Group2
> Group1 DefaultDbA
> Group2 DefaultDbB
> How is the default database determined if Login1 is connecting to the sql
> server?
> Best regards
> Ola Hallengren|||Thanks, Tibor. I agree with you that applications should not depend on
default databases. This is not a problem for us. The problem we have is with
the administrators managing the database servers using the SQL Server client
tools.
Enterprise Manager
If the default database is not accessible you can not log on.
Query Analyzer
If the default database is not accessible you can not log on.
Management Studio
There is an option to specify a database in the connection that enables you
to log on, even if the default database is not accessible. However then the
graphical dialogs is not working.
We're considering going away from using default databases (leaving it to
master on all logins).
/Ola
"Tibor Karaszi" wrote:
> This is, to the best of my knowledge, not deterministic. There is not sett
ing for this. So, it could
> go either way. IMO, an app should never depend on default database - it sh
ould set the database in
> the connection string. You could, of course, add Login! as a login to SQL
Server and specify the
> default database for that login (I'm pretty certain that this would be hon
ored).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Ola Hallengren" <OlaHallengren@.discussions.microsoft.com> wrote in messag
e
> news:5A8547EF-89D3-4BE0-BD3F-AD1899F40F0B@.microsoft.com...
>|||> We're considering going away from using default databases (leaving it to
> master on all logins).
This is what I do. And I then let the tool specify the database (/d for QA,
in the registered server
for SSMS etc.)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ola Hallengren" <OlaHallengren@.discussions.microsoft.com> wrote in message
news:5D4CCE2E-E6BD-48DC-832D-517AB35364A4@.microsoft.com...[vbcol=seagreen]
> Thanks, Tibor. I agree with you that applications should not depend on
> default databases. This is not a problem for us. The problem we have is wi
th
> the administrators managing the database servers using the SQL Server clie
nt
> tools.
> Enterprise Manager
> If the default database is not accessible you can not log on.
> Query Analyzer
> If the default database is not accessible you can not log on.
> Management Studio
> There is an option to specify a database in the connection that enables yo
u
> to log on, even if the default database is not accessible. However then th
e
> graphical dialogs is not working.
> We're considering going away from using default databases (leaving it to
> master on all logins).
> /Ola
>
> "Tibor Karaszi" wrote:
>|||Perfect Match Finder
http://www.max-online.biz/idevaffil...iate.php?id=804
Online Web Promotion
http://www.max-online.biz/idevaffil...iate.php?id=804
For further details email me at maxonline.sunil@.gmail.com|||>IMO, an app should never depend on default database - it should set the
database in the connection string.
I'm thinking if there is a way to trace if the applications are specifying a
database on connection, or if they are depending on the default databases.
One way is of course to to change the default databases to master and see
which applications that fails. Is there a more elegant way?
/Ola Hallengren
"Tibor Karaszi" wrote:
> This is what I do. And I then let the tool specify the database (/d for QA
, in the registered server
> for SSMS etc.)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Ola Hallengren" <OlaHallengren@.discussions.microsoft.com> wrote in messag
e
> news:5D4CCE2E-E6BD-48DC-832D-517AB35364A4@.microsoft.com...
>
No comments:
Post a Comment