通过 SQL Server 中的存储过程获取数据时,我收到如下错误
Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.
我仅在访问特定存储过程时收到此错误,而不是在访问所有 SP 时收到此错误。
最佳答案
为您的数据库指定一个有效的所有者。试试这个:
ALTER AUTHORIZATION
ON DATABASE::[YourDatabaseName]
TO [LoginUser];
或者你可以尝试这样设置
USE [dbname]
GO
sp_changedbowner 'someLogin'
关于sql - 原理Sql Server中不存在dbo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37385021/