DENY user access to particular column of a table

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 293
First we suppose to have one database user 'TestUser', table name is TestTable and which is having a columns FirstName, UserName, Password, EmailID and PhoneNumber....


If you want to give table access to the user 'TestUSer' except the column Password...


-- grant SELECT privilege at object level
GRANT SELECT ON TestTable TO PUBLIC
-- DENY at the column level
DENY SELECT (Password ) ON TestTable TO TestUser
GO

Comments or Responses

Login to post response