Monday, January 2, 2012

Retrieve current user permissions in SQL

To get the list of permissions available for the current user on a Db or an object in the Db,use the function"fn-my-permissions".This function takes arguments,name of the DB or object and whether the first argument you specified is a DB or an object .
The fallowing example gets the DB level permissions on the DB for the current user
select *from fn-my-permissions('My DB','Database')
The fallowing example gets the object level permissions on orders table for the current user
select *from fn-my-permissions('orders','object')
Post a Comment

Bel