Dbo principle does not exist on Sql server

When retrieving data through a stored procedure in SQL Server, I get an error like

It is not possible to fulfill the role of the database, because the main "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.

I get this error only for access to a specific stored procedure, and not for all SPs.

+4
source share
2 answers

Give your database a valid owner. Try the following:

ALTER AUTHORIZATION 
ON DATABASE::[YourDatabaseName]
TO [LoginUser];

or you can try installing it as

USE [dbname]
GO
sp_changedbowner 'someLogin'
+8
source
ALTER AUTHORIZATION ON DATABASE::Example TO sa;
+1
source

All Articles