Grant and revoke privileges in SQL Server (Transact-SQL) with syntax and examples.

You can GRANT and REVOKE privileges on various database objects in SQL Server. We'll look at how to grant and revoke privileges on tables in SQL Server.

Grant Privileges on Table

You can grant users various privileges to tables. These permissions can be any combination of SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER, or ALL.
Permission for object level:

Permission for database level:


Syntax

The syntax for granting privileges on a table in SQL Server is:
GRANT privileges ON object TO user;

Object: 
The name of the database object that you are granting permissions for. In the case of granting privileges on a table, this would be the table name.

User: 
The name of the user that will be granted these privileges.


Privileges:

The privileges to assign. It can be any of the following values:


Examples: