Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

MS SQL Server: Grant // Revoke Permissions in SQL Server

Understand MS SQL Server: Grant // Revoke Permissions in SQL Server with clear explanations, practical examples, and useful tips. This updated guide covers...

Table of Contents

MS SQL Server: Grant // Revoke Permissions in SQL Server is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.

You can grant, grant, delegate or revoke on many objects in the database of SQL Server. You will show you how to decentralize and revoke permissions.

Decentralize on the table

Can assign permissions to users on the table with the rights granted can include SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER or ALL.

Syntax

 GRANT quyen ON doi_tuong TO nguoi_dung; 

Quyen

Permissions specified for the user. Maybe:

Right Description SELECT Ability to execute SELECT statement on INSERT table Ability to execute INSERT command on UPDATE table Ability to execute UPDATE command on DELETE table Ability to execute DELETE command on table REFERENCES Ability to create constraints refer to ALTER table The ability to execute the ALTER TABLE statement on the table to change the table definition. ALL ALL does not grant all rights on the table but grants rights under ANSI-92 standard, including SELECT, INSERT, UPDATE, DELETE and REFERENCES.

Subjects

The name of the database object you want to empower. In the case of empowerment on the table, it is the table name.

nguoi_dung

Usernames will be empowered.

As an example,

If you want to grant SELECT, INSERT, UPDATE and DELETE permissions on the table for users to be smithj, run the GRANT command below.

 G RANT SELECT, INSERT, UPDATE, DELETE ON nhanvien TO smithj; 

Revoke permissions on the board

After empowerment, you may want to revoke the given rights with the REVOKE command, withdraw the SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER or ALL permissions.

Syntax

 REVOKE quyen ON doi_tuong FROM nguoi_dung; 

Quyen

Rights will be revoked, possibly:

Right Description SELECT Ability to execute SELECT statement on INSERT table Ability to execute INSERT command on UPDATE table Ability to execute UPDATE command on DELETE table Ability to execute DELETE command on table REFERENCES Ability to create constraints refer to ALTER table The ability to execute the ALTER TABLE statement on the table to change the table definition. ALL ALL does not grant all rights on the table but grants rights under ANSI-92 standard, including SELECT, INSERT, UPDATE, DELETE and REFERENCES.

Subjects

The name of the database object you want to revoke permissions. In the case of empowerment on the table, it is the table name.

nguoi_dung

User name will be revoked.

As an example,

If you want to revoke the DELETE permission on the user account of the anderson user, run the REVOKE command below.

 REVOKE DELETE ON the user FROM anderson; 

FAQ

What should you know about decentralize on the table?

Can assign permissions to users on the table with the rights granted can include SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER or ALL.

What should you know about revoke permissions on the board?

After empowerment, you may want to revoke the given rights with the REVOKE command, withdraw the SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER or ALL permissions.

What is MS SQL Server: Grant // Revoke Permissions in SQL Server?

You can grant, grant, delegate or revoke on many objects in the database of SQL Server.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.