我有两个数据库。一个带有数据,另一个带有存储过程。用户不应该直接读取数据,而只能通过存储过程读取数据。 在服务器和所有数据库上启用标志“跨数据库所有权链接”。MS SQL 2014跨数据库访问不工作,因为我期望
由于SA我做:
use data_db
create table dbo.t(....)
insert into t values(....)
use sp_db
create procedure dbo.readt as
select * from data_db.dbo.t
grant execute on dbo.readt to user1
现在我重新为USER1
execute sp_db.dbo.readt
,我得到一个错误:
The server principal "user1" is not able to access the database "data_db" under the current security context.
我在做什么错?