Sunday, February 19, 2012

dbo permissions

Is it possible for the dbo account to have a login to an SQL server?
If so how can that be discontinued?dbo is a special user account that exists in every database
but there isn't a login named dbo.
The login that owns the database is has the name DBO in that
database.
It's easier to not think of dbo as an user account as it
doesn't have a login and doesn't work like a typical user in
a database.
One other note on the login and hope this doesn't confuse
things but dbo isn't a login based on the special account
that exists in all databases. By default and generally on
most SQL Servers there is no login dbo. In theory you can
create a SQL login named dbo but it's not the same thing.
isn't a good practice and confuses things quite a bit. I saw
one place do that before...not a good thing to create
something like that.
-Sue
On Wed, 21 Sep 2005 13:39:08 -0400, "robertcp"
<rplance@.bmhsc.org> wrote:

>Is it possible for the dbo account to have a login to an SQL server?
>If so how can that be discontinued?
>|||To add to Sue's response, it is possible to create a SQL login that is used
only for database ownership and then change database ownership to that
login. Only that login will map to the 'dbo' user. However, note that
sysadmin role members are 'dbo' in all databases.
USE MyDatabase
DECLARE @.StrongPassword sysname
SET @.StrongPassword = NEWID()
EXEC sp_addlogin 'DatabaseOwner', @.StrongPassword
EXEC sp_changedbowner 'DatabaseOwner'
Hope this helps.
Dan Guzman
SQL Server MVP
"robertcp" <rplance@.bmhsc.org> wrote in message
news:eUQ9fNtvFHA.1988@.TK2MSFTNGP10.phx.gbl...
> Is it possible for the dbo account to have a login to an SQL server?
> If so how can that be discontinued?
>

No comments:

Post a Comment