Access rights to View

  • Hi,

    I have create a view in a database (assume a_db)

    now this view fetching records from other database(assume b_db) like (select col1,col2 from b_db..tab1)

    Now i have create a user in database a_db as User_A

    i have added User_A to db_datareader roles for a_db database.

    But when i login with user User_A and try to acces this view getting msg like

    The server principal "User_A" is not able to access the database "b_db" under the current security context.

    do i need to add User_A into b_db database datareader roles. which i dont want to do?

    [font="Arial Narrow"]Failure is not the worst thing. The worst Thing is not to try[/font]
  • Virender Sihag (10/3/2011)


    Hi,

    I have create a view in a database (assume a_db)

    now this view fetching records from other database(assume b_db) like (select col1,col2 from b_db..tab1)

    Now i have create a user in database a_db as User_A

    i have added User_A to db_datareader roles for a_db database.

    But when i login with user User_A and try to acces this view getting msg like

    The server principal "User_A" is not able to access the database "b_db" under the current security context.

    do i need to add User_A into b_db database datareader roles. which i dont want to do?

    You can add User_A to b_db as a user (without any specific role) then grant select permissions on the table(s) required for the view. This should allow the user to access the view and will be the minimum required permission set (I believe).

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply