script to grant execute permission if missing

  • can some body please bring me the pace ,actually i am looking small script

    1)check if particular db user has execute permission for one of our SP

    2)if permission is missing ,give the execute permission to that user for SP

  • Why check first? Granting permission doesn't fail if the user already has permission.

    If you really want, you should be able to hack up a query based on sys.database_principals and sys.database_permissions

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks , is there any way i can do this with policy management?

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

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