Table Column level security (Again!)

  • The subject of restricting access to specific columns in a table has been discussed many times on this and other forums before.  If you aren't aware, you can deny access to one or more columns in a table for a specific user etc.

    DENY SELECT ON Matters(issue) TO [RestrictedAccess]

    will deny access to column Issue in table Matters to user RestrictedAccess.

    Executing SELECT * FROM Matters results in:

    The SELECT permission was denied on the column 'Issue' of the object 'Matters', database 'Unit', schema 'dbo'.

    My question to the community is:

    Is there any way to suppress this error and instead return all columns specified but with the content of restricted column(s) replaced by '*' or some other masking character?

    This would be far more useful than raising an error.

  • Thanks.  Didn't know of this.  Having looked at it now, initially it seems to be a useful feature but in fact it applies the same masking rights to all users.  I would want to be able to restrict data from some columns in table A to Users A and B but not C.  I would want to restrict data from some columns in table B to users C but not A or B.

  • Oh, if you're trying to restrict groups of users from seeing rows, then use Row Level Security. \

Viewing 4 posts - 1 through 4 (of 4 total)

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