select permission on view

  • 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

  • Possible change in the ownership chain. Who owns the view and who owns the underlying table(s)?

  • 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

  • Are the schemas owned by the principal?

    select * from sys.schemas;

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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