Re: Login Name is missing

From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 10/23/02


From: "Dan Guzman" <danguzman@nospam-earthlink.net>
Date: Tue, 22 Oct 2002 20:56:34 -0500


Database ownership determines to login mapping for the 'dbo' user. You
can use sp_changedbowner to specify the database owner and login mapped
to the 'dbo' user. For example:

    USE MyDatabase
    EXEC sp_changedbowner 'sa'
    GO

--
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy  Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"mitra fathollahi" <mitra@entelagent.com> wrote in message
news:b33501c27a30$93dabcc0$35ef2ecf@TKMSFTNGXA11...
> Hello Everyone,
>
> I received a copy of one of our Client's database file and
> we were able to restore the database in our SQL Server 7.
>
> After restoring the database, i looked at the Tables, and
> I see 'dbo' listed as the OWNER of all the tables.
> However, when i go to the Users for this database, 'dbo'
> is being displayed for the Name, but there is no Name for
> the Login Name.
>
> Can someone please tell me if i don't have any name listed
> for the Login Name in Users then who is the Owner of all
> the tables in this database.
>
> Can i add a new User from my Logins list that's available
> in my Security folder and have this New User be the OWNER
> of these tables?
> I assume if i could do this then i need to go through all
> 150 tables and execute the sp_changeobjectowner to change
> the object OWNER, right?
>
> Is there any way i can get a valid Login Name for the dbo?
>
> I appreciate any help!
> Thank you,
> Mitra


Relevant Pages

  • Re: Accidentally dropped DBO from database
    ... That error is due to having databases where the owner (dbo) ... is mapped to a login that doesn't exist on the server. ... a user in the database" when using sp_changedbowner, ...
    (microsoft.public.sqlserver.security)
  • Re: Confused about dbo
    ... Make sure you understand the difference between login names and user names. ... database within a SQL Server instance. ... There are several ways you could have the username dbo. ... the true owner of the database. ...
    (microsoft.public.sqlserver.security)
  • Re: db_owner role in SQL 2k
    ... The owner of a database is a login, which is listed in the sysdatabases ... I try not to think of DBO as the Database Owner, but just as special, ... For anyone to use any database, their login name must have been given access ...
    (microsoft.public.sqlserver.programming)
  • Re: properties owner and users owner.
    ... 'dbo' is a special database user and must exist in every database. ... normally be the same login but can get out-of-sync in some situations, ... owner entries are synchronized: ...
    (microsoft.public.sqlserver.server)
  • Re: Who should I make the owner?
    ... Every login gets mapped to a username in every database they have access to. ... DBO is a special user name that exists in every database. ... NOT to think of DBO as meaning 'database owner' since many different logins ...
    (microsoft.public.windows.server.general)