Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Data control language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Microsoft SQL Server == In [[Microsoft SQL Server]] there are four groups of SQL commands:<ref name="sql-server-tip-card">{{Cite web|title=SQL Clause, Statement, Command, Expression and Batch Defined|first=Aubrey|last=Love|date=March 28, 2023|url=https://www.mssqltips.com/sqlservertip/7575/sql-clause-statement-command-expression-batch-definition/|access-date=2025-01-26|website=MSSQLTips}}</ref> * Data Manipulation Language (DML) * Data Definition Language (DDL) * Data Control Language (DCL) * Transaction Control Language (TCL) DCL commands are used for access control and permission management for users in the database. With them we can easily allow or deny some actions for users on the tables or records (row level security). DCL commands are:<ref name="sql-server-tip-card" /> ;GRANT: gives specified permissions for the table (and other objects) to, or assigns a specified role with certain permissions to, specified groups or users of a database; ;REVOKE: takes away specified permissions for the table (and other objects) to, or takes away a specified role with certain permissions to, specified groups or users of a database; ;DENY: denies a specified permission to a security object. For example: GRANT can be used to give privileges to user to do SELECT, INSERT, UPDATE and DELETE on a specific table or multiple tables. The REVOKE command is used to take a privilege away (default) or revoking specific command like UPDATE or DELETE based on requirements. === Example === {{sxhl|2=tsql| Grant SELECT,INSERT,UPDATE,DELETE on Employees To User1 Revoke INSERT On Employees To User1 Deny Update On Employees to User1 }} In the first example, GRANT gives privileges to user User1 to do SELECT, INSERT, UPDATE and DELETE on the table named Employees. In the second example, REVOKE removes User1's privileges to use the INSERT command on the table Employees. DENY is a specific command. We can conclude that every user has a list of privilege which is denied or granted so command DENY is there to explicitly ban you some privileges on the database objects.:
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)