我有兩個數據庫。一個帶有數據,另一個帶有存儲過程。用戶不應該直接讀取數據,而只能通過存儲過程讀取數據。 在服務器和所有數據庫上啓用標誌「跨數據庫所有權鏈接」。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.
我在做什麼錯?