Re: dbo with user name in "users"



We've had some developers leave recently and I removed their logins. It might
be that one of them owned the database and because the login/user has been
removed the system can't validate them anymore. I thought the system always
asked to reassign the object in that case but maybe not.

Thanks Kalen,
--
Dan D.


"Kalen Delaney" wrote:

Dan

I have seen that problem with the NULL error message, and I still believe it
has something to do with not being able to validate the login. Other domain
logins might be able to be validated, or might be using cached credentials,
or something. But as you found, changing the owner to sa is usually a great
solution.

The owner of a database always has the user name dbo in the database, which
always give her full permissions. If you don't want that login to have full
permission, give ownership of the database to someone else.

--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com


"Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:841A0E2F-8DBE-437F-8661-2CFF7998404E@xxxxxxxxxxxxxxxx
When I run sp_helpdb on the database with a blank in the "login name"
column
for dbo, I get an error: "cannot insert the value NULL into column '',
table
''; column does not allow nulls. INSERT fails. I changed the dbowner to
'sa'
and it then worked correctly.

The other databases respond appropriately.

I do have some databases with a domain user as owner so I don't think the
domain is the problem.

In a database for an application, could I assign the database owner as a
user with limited (read/write) rights? Or would making the user the
database
owner override the read/write permissions?

Thanks,
--
Dan D.


"Kalen Delaney" wrote:

Hi Dan

The login name column should show the login name who is considered the
owner
of the database, whose user name will be 'dbo' when they use the
database. I
don't know why EM is sometimes showing a blank here. There should always
be
a mapped login name. One guess is that the login of the owner is a domain
account, and the domain is not available to validate the name. You can
try
to verify that by run sp_helpdb in a query window, and seeing what gets
listed for the owner of the database.

You can change the login name that owns a database by using a query
window.
Use the database, and run the following:

EXEC sp_changedbowner '<new_owner_login_name>'

--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com


"Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C8FC2930-1CC2-4BEF-BACA-C292396E498E@xxxxxxxxxxxxxxxx
Using SS2000 SP4. Under "Users" in EM, I see "dbo" in the name column
and
in
the login name column a name like "webapp". In other databases, I see
"dbo"
in the name column and nothing in the login name column.

What is the significance of having another user like "webapp" in the
login
name column? And how could can I assign another user login to dbo?

Thanks,
--
Dan D.






.



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: Login Name is missing
    ... Database ownership determines to login mapping for the 'dbo' user. ... > I see 'dbo' listed as the OWNER of all the tables. ...
    (microsoft.public.sqlserver.security)
  • 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)