Gurus,
Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
mappings, a lot of times their default database is "Master" instead of the
various application databases which exist on the server. Which is correct,
pointing at master or to their specific application database?
--
SpinBoth are correct. It's a matter of how you'd like to set the default database
of a login, and you can use sp_defaultdb to change it. The most likely reason
why they have different default databases is that the logins were not created
consistently. Some were created with an explicit default database, while the
other were created without an explicit default, in which case master would be
chosen as the default database for the login.
Linchi
"Spin" wrote:
> Gurus,
> Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
> mappings, a lot of times their default database is "Master" instead of the
> various application databases which exist on the server. Which is correct,
> pointing at master or to their specific application database?
> --
> Spin
>|||"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
> Both are correct. It's a matter of how you'd like to set the default
> database
> of a login, and you can use sp_defaultdb to change it. The most likely
> reason
> why they have different default databases is that the logins were not
> created
> consistently. Some were created with an explicit default database, while
> the
> other were created without an explicit default, in which case master would
> be
> chosen as the default database for the login.
But if users cannot login into "Master" than it would make sense for
performance reasons (faster login) to properly set the databse during
account setup correct?
Spin|||Spin
I do not know your business requirements as well as how your application
does the work.
What if you set default database and that database git corrupted. Login
could bot connect to the server to see/repair the database?
"Spin" <Spin@.invalid.com> wrote in message
news:64bk62F2agtgvU1@.mid.individual.net...
> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
>> Both are correct. It's a matter of how you'd like to set the default
>> database
>> of a login, and you can use sp_defaultdb to change it. The most likely
>> reason
>> why they have different default databases is that the logins were not
>> created
>> consistently. Some were created with an explicit default database, while
>> the
>> other were created without an explicit default, in which case master
>> would be
>> chosen as the default database for the login.
> But if users cannot login into "Master" than it would make sense for
> performance reasons (faster login) to properly set the databse during
> account setup correct?
> Spin
>|||> But if users cannot login into "Master"
You don't "login" to a database. You login to the instance and then "use" a database. Also, every
login can use master since there is a guest user in the master database.
> than it would make sense for performance reasons (faster login) to properly set the databse during
> account setup correct?
Default database do no affect login time.
In most cases the default database is irrelevant since your application will connect to the desired
database thanks to the db name specified in the connection string.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Spin" <Spin@.invalid.com> wrote in message news:64bk62F2agtgvU1@.mid.individual.net...
> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
>> Both are correct. It's a matter of how you'd like to set the default database
>> of a login, and you can use sp_defaultdb to change it. The most likely reason
>> why they have different default databases is that the logins were not created
>> consistently. Some were created with an explicit default database, while the
>> other were created without an explicit default, in which case master would be
>> chosen as the default database for the login.
> But if users cannot login into "Master" than it would make sense for performance reasons (faster
> login) to properly set the databse during account setup correct?
> Spin
>|||Tibor
If you try connect with a login who has corrupted/notexistence database (
was set as a deafult) then you cannot connect to the server, I think that is
what the OP meant .
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23BqVbWZiIHA.4140@.TK2MSFTNGP04.phx.gbl...
>> But if users cannot login into "Master"
> You don't "login" to a database. You login to the instance and then "use"
> a database. Also, every login can use master since there is a guest user
> in the master database.
>> than it would make sense for performance reasons (faster login) to
>> properly set the databse during account setup correct?
> Default database do no affect login time.
> In most cases the default database is irrelevant since your application
> will connect to the desired database thanks to the db name specified in
> the connection string.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Spin" <Spin@.invalid.com> wrote in message
> news:64bk62F2agtgvU1@.mid.individual.net...
>> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
>> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
>> Both are correct. It's a matter of how you'd like to set the default
>> database
>> of a login, and you can use sp_defaultdb to change it. The most likely
>> reason
>> why they have different default databases is that the logins were not
>> created
>> consistently. Some were created with an explicit default database, while
>> the
>> other were created without an explicit default, in which case master
>> would be
>> chosen as the default database for the login.
>> But if users cannot login into "Master" than it would make sense for
>> performance reasons (faster login) to properly set the databse during
>> account setup correct?
>> Spin
>>
>|||Hi Uri,
> If you try connect with a login who has corrupted/notexistence database ( was set as a deafult)
> then you cannot connect to the server
Correct, for some applications. Where other will fall back to some other database.
> , I think that is what the OP meant .
I don't think so. I do not see any reference to a non-existing default database in below OP's post,
to which my reply was for:
>> But if users cannot login into "Master" than it would make sense for performance reasons (faster
>> login) to properly set the databse during account setup correct?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:OEmgtdZiIHA.4076@.TK2MSFTNGP05.phx.gbl...
> Tibor
> If you try connect with a login who has corrupted/notexistence database ( was set as a deafult)
> then you cannot connect to the server, I think that is what the OP meant .
>
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23BqVbWZiIHA.4140@.TK2MSFTNGP04.phx.gbl...
>> But if users cannot login into "Master"
>> You don't "login" to a database. You login to the instance and then "use" a database. Also, every
>> login can use master since there is a guest user in the master database.
>> than it would make sense for performance reasons (faster login) to properly set the databse
>> during account setup correct?
>> Default database do no affect login time.
>> In most cases the default database is irrelevant since your application will connect to the
>> desired database thanks to the db name specified in the connection string.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Spin" <Spin@.invalid.com> wrote in message news:64bk62F2agtgvU1@.mid.individual.net...
>> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
>> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
>> Both are correct. It's a matter of how you'd like to set the default database
>> of a login, and you can use sp_defaultdb to change it. The most likely reason
>> why they have different default databases is that the logins were not created
>> consistently. Some were created with an explicit default database, while the
>> other were created without an explicit default, in which case master would be
>> chosen as the default database for the login.
>> But if users cannot login into "Master" than it would make sense for performance reasons (faster
>> login) to properly set the databse during account setup correct?
>> Spin
>>
>>
>|||Hi Tibor
> Correct, for some applications.
Such as QA :-))))
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
I re-read his post. You got it right.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGd0fRaiIHA.6032@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
>> If you try connect with a login who has corrupted/notexistence database
>> ( was set as a deafult) then you cannot connect to the server
> Correct, for some applications. Where other will fall back to some other
> database.
>
>> , I think that is what the OP meant .
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
>> But if users cannot login into "Master" than it would make sense for
>> performance reasons (faster login) to properly set the databse during
>> account setup correct?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OEmgtdZiIHA.4076@.TK2MSFTNGP05.phx.gbl...
>> Tibor
>> If you try connect with a login who has corrupted/notexistence database
>> ( was set as a deafult) then you cannot connect to the server, I think
>> that is what the OP meant .
>>
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in message news:%23BqVbWZiIHA.4140@.TK2MSFTNGP04.phx.gbl...
>> But if users cannot login into "Master"
>> You don't "login" to a database. You login to the instance and then
>> "use" a database. Also, every login can use master since there is a
>> guest user in the master database.
>> than it would make sense for performance reasons (faster login) to
>> properly set the databse during account setup correct?
>> Default database do no affect login time.
>> In most cases the default database is irrelevant since your application
>> will connect to the desired database thanks to the db name specified in
>> the connection string.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Spin" <Spin@.invalid.com> wrote in message
>> news:64bk62F2agtgvU1@.mid.individual.net...
>> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
>> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
>> Both are correct. It's a matter of how you'd like to set the default
>> database
>> of a login, and you can use sp_defaultdb to change it. The most likely
>> reason
>> why they have different default databases is that the logins were not
>> created
>> consistently. Some were created with an explicit default database,
>> while the
>> other were created without an explicit default, in which case master
>> would be
>> chosen as the default database for the login.
>> But if users cannot login into "Master" than it would make sense for
>> performance reasons (faster login) to properly set the databse during
>> account setup correct?
>> Spin
>>
>>
>>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment