Sunday, February 19, 2012

Giving user permissions tp columns

Hi
I have created a user and given select permissions on a table, I want to go deeper and just give select on a few columns within the table but unable to do so. Can someone tell me how I can do this.
ThanksRevoke the SELECT right for that table from the user.
Create a view that contains only the columns he/she should see
Grant the user SELECT on that view.

P.S.: what do you mean with "tp columns"? Is tp your abbreviation for table?|||Thanks for that.

It was meant to say to it was a typo.

Thanks Shammat|||Do you know what Books Online is?

From BOL:

GRANT
{ ALL [ PRIVILEGES ] | permission [ ,...n ] }
{
[ ( column [ ,...n ] ) ] ON { table | view }
| ON { table | view } [ ( column [ ,...n ] ) ]
| ON { stored_procedure | extended_procedure }
| ON { user_defined_function }
}
TO security_account [ ,...n ]
[ WITH GRANT OPTION ]
[ AS { group | role } ]|||Yes I do but I forgot it was there.

No comments:

Post a Comment