synonyms permission

  • I have two database having same table object say tbl

    db1 and db2

    Now I created a schme sch in db1

    synonyms in db1 for db2.tbl in that schma

    so now db 1 has dbo.tbl and sch.tbl

    and I created procedure proc

    as

    select * from dbo.tbl

    UNION ALL

    select * from sch.tbl

    and grant execute permission to user test

    this user dose not have select permission on any of das

    when i run this proc it gives error on db2.tbl that

    The SELECT permission was denied on the object

    what is the bast way without givint user a select permission I can run this proc

    Thanks

  • You have to right click on db2.tbl and give the user rights to read this table.

    Perhaps use a ROLE and just give select rights to the user.

    Put user in a ROLE and then just give db2.tbl select rights only.

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

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