• sage8 (8/20/2012)


    The result for:

    USE [your_database];

    GO

    SELECT SUSER_NAME(principal_id)

    FROM sys.database_principals

    WHERE name = 'dbo';

    GO

    is 'sa'

    OK, that is what it should be. Nothing to be concerned about. Since SQL 2005 (at least) dbo will exist as a user in every database and be mapped to the sa login. From some of your earlier posts it sounded like a login other than sa was mapped to dbo which could have become an issue. Something like that could have been the bad outcome from upgrading a SQL 2000 database that had had its system tables manually updated.

    When the sa login, or any login in the sysadmin Role, enters a database they enter as the dbo User. That is just how it works. Test it while logged in using:

    SELECT USER_NAME();

    If the user is in the sysadmin Role, even if they have a Database User in the database for their Login, they'll still be mapped into the database as the dbo User.

    edit: spelling

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato