how to give GRANT VIEW DEFINITION to triggers in SQL Server 2005

  • Hi,

    I want to give view defination permission some users for triggers created in a particualr database in SQL 2005 by :

    "GRANT VIEW DEFINITION ON [abc] TO xyz"

    but while executing this i am getting following error:

    Msg 15151, Level 16, State 1, Line 2

    Cannot find the object 'abc', because it does not exist or you do not have permission.

    this trigger do exists in database and i have sa permission but not sure why this error comming, cann't we give view definition permission in SQL 2005 to triggers or it has some different way?

    thanks,

    DG

  • You can't go at trigger level, you'll have to set the permissions at table level.

    -- Gianluca Sartori

  • But i have seen some sites showing its possible:

    WHERE type IN ('P', 'V', 'FN', 'TR', 'IF', 'TF', 'U')

    /*

    Included Object Types are:

    P - Stored Procedure

    V - View

    FN - SQL scalar-function

    TR - Trigger

    IF - SQL inlined table-valued function

    TF - SQL table-valued function

    U - Table (user-defined)

    */

    but not sure exactely how?

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

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