Mastering Transact-SQL Authorization Flashcards
Explore key concepts of Transact-SQL authorization with these engaging flashcards.
Who can execute statements or perform operations on an entity?
Only authorized users are able to execute statements or perform operations on an entity.
What happens if an unauthorized user attempts to execute a Transact-SQL statement?
The execution of the Transact-SQL statement or the operation on the database object will be rejected.
What are the three Transact-SQL statements related to authorization?
The three Transact-SQL statements are: GRANT, DENY, and REVOKE.
What is the syntax for the GRANT statement?
GRANT {ALL [PRIVILEGES]} | permission_list [ON [class::] securable] TO principal_list [WITH GRANT OPTION] [AS principal]
Provide an example of a GRANT statement.
GRANT CREATE TABLE, CREATE PROCEDURE TO peter, mary
Example of granting multiple permissions.
What does the WITH GRANT OPTION do in a GRANT statement?
It gives user B the additional capability of granting the privilege to other users.
What does the DENY statement do?
The DENY statement prevents users from performing actions and removes existing permissions.
What is the syntax for the DENY statement?
DENY {ALL [PRIVILEGES]} | permission_list [ON [class::] securable] TO principal_list [CASCADE] [AS principal]
Provide an example of a DENY statement.
DENY CREATE TABLE, CREATE PROCEDURE TO peter
Example of denying multiple permissions.
What does the REVOKE statement do?
The REVOKE statement removes one or more previously granted or denied permissions.
What is the syntax for the REVOKE statement?
REVOKE [GRANT OPTION FOR] { [ALL [PRIVILEGES]] | permission_list } [ON [class::] securable] FROM principal_list [CASCADE] [AS principal]