March 6, 2013 at 12:06 pm
I understand one reason to use view is for security.
So we have a view and granted a user select permission to that view.
But we got a denied message when select the view?
The SELECT permission was denied on the object 'table1', database 'mydb', schema 'dbo'.
It is denied because it doesn't have select for underlying table. My understand is we don't need underlying table permisson.
Why it asks underlying table permission?
One thing i notice though the view is different schema than the underlying table, does it make a difference?
Thanks
March 6, 2013 at 12:10 pm
Possible change in the ownership chain. Who owns the view and who owns the underlying table(s)?
March 6, 2013 at 12:15 pm
how can I find out the owner of a view or the owner of table,
I click view- property, I don't see anywhere says owner?
Thanks
March 6, 2013 at 12:23 pm
Are the schemas owned by the principal?
select * from sys.schemas;
March 6, 2013 at 12:24 pm
if the view "dbo.myview" references any objects in another database, a linked server or a schema different than dbo, then that's breaking the cross database chain.
you said it was referencing another schema, so the user needs permissions on the underlying object.
if it's a view referencing another database, and you'd have to create the user in that database as well.
Lowell
March 6, 2013 at 12:28 pm
Lowell (3/6/2013)
if the view "dbo.myview" references any objects in another database, a linked server or a schema different than dbo, then that's breaking the cross database chain.i suspect it's a view referencing another database, and you'd have to create the user in that database as well.
Thanks, Lowell, you are right.
This view is like external.myview
The underlying tables are in a different database on the same server but it is dbo schema.
And the user is in that database, but it does not have select permission on that new table.
So I think I will just need to add the table to the role.
So this is a break cross database chain issue, thanks
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply