Skip to content
Advertisement

Grant Select To Synonym For Specified Columns

I’ve been trying to restrict a user’s select access to a synonym. Consider the following below:

I get an error:

Msg 1020, Level 16, State 3, Line 4
Sub-entity lists (such as column or security expressions) cannot be specified for entity-level permissions.

But if I change it to use dbo.Items directly then it works:

How can I restrict the SELECT on a synonym for a specified user? Is this possible? If no, are there any alternatives?

Advertisement

Answer

“How can I restrict the SELECT on a synonym for a specified user? “ You can’t. A Synonym is just an alternative name for an object. The check to see if the object even exists is deferred till runtime when referencing the SYNONYM not when it’s created. For example CREATE SYNONYM dbo.MySynonym FOR MadeUp.TableObject; will create the synonym even though the reference object doesn’t exist.

All the permissions need to be set up the object that the Synonym references, not the synonym itself.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement