SQL Server principal “dbo” does not exist,

后端 未结 11 840
醉话见心
醉话见心 2020-12-22 16:05

I am getting the following error

Cannot execute as the database principal because the principal \"dbo\" 
does not exist, this type of principal cannot be imp         


        
相关标签:
11条回答
  • 2020-12-22 16:22

    If the above does not work then try the following. It solved the problem for me even when the owner was well defined for the database.

    SQL Server 2008 replication failing with: process could not execute 'sp_replcmds'

    0 讨论(0)
  • 2020-12-22 16:23
    USE [<dbname>]
    GO
    sp_changedbowner '<user>' -- you can use 'sa' as a quick fix in databases with SQL authentication
    

    KB913423 - You cannot run a statement or a module that includes the EXECUTE AS clause after you restore a database in SQL Server 2005

    0 讨论(0)
  • 2020-12-22 16:23

    As the message said, you should set permission as owner to your user. So you can use following:

    ALTER AUTHORIZATION 
    ON DATABASE::[YourDBName]
    TO [UserLogin];
    

    Hope helpful! Leave comment if it's ok for you.

    0 讨论(0)
  • 2020-12-22 16:26

    Under Security, add the principal as a "SQL user without login", make it own the schema with the same name as the principal and then in Membership make it db_owner.

    0 讨论(0)
  • 2020-12-22 16:29

    another way of doing it

    ALTER AUTHORIZATION 
    ON DATABASE::[DatabaseName]
    TO [A Suitable Login];
    
    0 讨论(0)
  • 2020-12-22 16:33

    Also had this error when accidentally fed a database connection string to the readonly mirror - not the primary database in a HA setup.

    0 讨论(0)
提交回复
热议问题