Reputation: 883
I want to grant read permissions for a user for a view which joins 2 tables from another database. I don't want to:
truncate
and a stored procedure which inserts the data on a trigger.Can this be done somehow? Maybe there's something I missed and you guys might know.
I have read these posts but they didn't solve my problem: Grant SELECT permission on a view, but not on underlying objects
Grant Select on a view not base table when base table is in a different database
https://msdn.microsoft.com/en-us/library/ms188676.aspx
Thank you
Edit:
The easiest solution I came up with, after some research, is activating the cross database ownership chaining
option on the database where I'm placing the views and granting the read permission to the users. This might be in contrast with my 2nd point of things I'm trying to avoid. Is this a good idea?
Upvotes: 1
Views: 5828
Reputation: 883
What I ended up doing:
Couldn't find a solution for my original question without the AD group.
Upvotes: 0
Reputation: 3162
Give them a login to another database on the same server, and include only your single view, with the view pointing to your secure database. Don't give that login any access to anything but the database with the view in it, and only read access to that single view. Obviously, you'll have to fully qualify your table name (e.g., from SourceDB.dbo.SomeSecretTable
).
Upvotes: 1