MSDN

Microsoft Docs

Data Control Language (DCL)

The Data Control Language (DCL) statements are used to control access to data and database objects. DCL includes the following statements:

GRANT

Use GRANT to give a principal access rights to a securable.

GRANT SELECT, INSERT ON dbo.TableA TO [UserA];
ClauseDescription
SELECT, INSERTPermissions being granted.
ON dbo.TableAThe object to which permissions apply.
TO [UserA]The principal receiving the permissions.

REVOKE

Removes previously granted or denied permissions.

REVOKE INSERT ON dbo.TableA FROM [UserA];

If a permission is not explicitly granted, revoking has no effect.

DENY

Explicitly denies a permission. Denied permissions take precedence over granted ones.

DENY SELECT ON dbo.TableA TO [UserB];

Use with caution, as it overrides any future GRANT statements for the same permission.

Best Practices