Monday, February 8, 2010

SQL Server Server Data control

Define Data control language.

Answer
A data control language is a computer language used to control access data in a database. It is used to manipulate and control the data. Examples of commands that are a part of Data control language: SELECT, CONNECT, INSERT, UPDATE etc

Explain the command Grant, Revoke and Deny with syntax.

Answer
a. Grant
: Grant is used to grant or give access permission to a user. These permissions can be given to a user or a role. Grant can be used to give system privileges or object privileges.

Syntax:
Grant ALL | system_privelege on object_name to user_name

Example:
Grant update on customer to steve

b. Revoke: Removes or takes away a previously assigned or granted privilege.

Syntax:
Revoke ALL | privilege_name
On object_name
From user_name

Example:
Revoke update
On customer
From steve

c. Deny: Used to deny permissions to a user.

Syntax:
Deny ALL | permission_name
On object_name
TO user_name

Example:
Deny update
On customer
To steve

No comments:

Post a Comment