Sql grant Command Explanation with Example

Posted by Prabhukiran345 under Sql Server category on | Points: 40 | Views : 1039
Swl grant Command:SQL GRANT is a command used to provide access or privileges on the database objects to the users.
GRANT privilege_name 
ON object_name
TO {user_name |PUBLIC |role_name}

privilege_name is the access right or privilege granted to the user.
object_name is the name of an database
user_name is the name of the user
PUBLIC is used to grant access rights
ROLES are a set of privileges grouped together
WITH GRANT OPTION allows a user to grant access rights to other users.

GRANT SELECT ON employee TO user1 

This command grants a SELECT permission on employee table to user1.

Comments or Responses

Login to post response