Re: Accidentally dropped DBO from database

From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 01/18/05


Date: Tue, 18 Jan 2005 12:58:38 -0700

You can use sp_changedbowner and dbo will map to whatever
login you assign as the database owner with
sp_changedbonwer.
You can find more information on sp_changedbowner in SQL
Server books online.

-Sue

On Tue, 18 Jan 2005 06:25:03 -0800, "Linda"
<Linda@discussions.microsoft.com> wrote:

>I altered a script that drops all users from a database and accidentally
>changes an AND to an OR so that the user DBO was dropped after a refresh from
>production to dev.
>
>Can I readd this user or is the only solution is to restore from backup?
>
>Thanks,
>Linda



Relevant Pages

  • Re: Roles & Users
    ... "John Bell" wrote in message ... >> I think just saying things like 'dbo is the database owner' can lead to ... >> It is the user name assumed by the login listed in sysdatabases as the ...
    (microsoft.public.sqlserver.server)
  • Re: Event ID 28005; Error 15517
    ... If this database was restored from another server, the login that is the ... database owner (and therefore the login that becomes dbo) does not exist on ... try changing the database owner by running: ...
    (microsoft.public.sqlserver.security)
  • Re: Roles & Users
    ... John ... > DBO is simply a user name in a database, albeit a special, privileged one. ... > It is the user name assumed by the login listed in sysdatabases as the ... > database owner, as well as by any logins in the sysadmin role, or any ...
    (microsoft.public.sqlserver.server)
  • Re: Roles & Users
    ... DBO is simply a user name in a database, albeit a special, privileged one. ... It is the user name assumed by the login listed in sysdatabases as the ... database owner, as well as by any logins in the sysadmin role, or any login ...
    (microsoft.public.sqlserver.server)
  • Re: db_owner role in SQL 2k
    ... Try not to say "If sa is THE dbo", it's like saying "If I am the joe". ... might help to either say "If sa is the database owner" or, ... The login 'sa' could be listed in sysdatabases as the database ... FULL permission to do anything and everything. ...
    (microsoft.public.sqlserver.programming)