Views: already existing permissions for groups (roles)
Views:View appears like a table to the database user withmany rows and columns of data. Views is a virtual table.
With views users arerestricted from viewing particular columns and rows which ensures that data isnot manipulated or seen by unauthorizedpeople. It is helpful to turninformation from multiple tables into a single view. It is used to hide thecomplicated queries.
Example of creating view:CREATE VIEWvtest AS selectvoterid,votername fromvoterstable. Grant:For a user to do anything on an SQL Server, he or shemust have permission. Such permission is accorded via a GRANT command.
Withgrant command we will give permissions to a user that can perform on databasesor database objects. The different permissions are create database object, orretrieve information from database objects, or manipulate the databaseobjects. Granting privileges on Table:If we want a user to insert the data into the tablethen first user has to grant to perform insert operation on table by usingGRANT INSERT ON employee totest_userWe also have WITH GRANT option for GRANT command whichindicates the granted user has a right to grant same privilege to other user. Deny:DENY blocks access. DENY affectsall other access. For instance, when a user has both DENY and GRANT to anobject, DENY takes effect.
DENY locks access while Revoking a DENY re-forms theaccess. Consequently, issuing a REVOKE to an object without permission at theuser level causes no error. The GRANT command succeeds at the SQL Server level.DENY statement is used to deny alreadyexisting permissions for groups (roles) to a few members of the group. Example: DENY CREATE TABLE, CREATE PROCEDURE to test_user Revoke:Revoke remove or undo permission undoes any prior permission,whether a GRANT or a DENY.
For example, when Revoke is issued, and a GRANT testrerun, the user fails to see the previous query. Revoke is never meant to blockor cancel a GRANT, it just removes the permission issues to a specific user atspecific level.Example:REVOKE INSERT ON employee FROMtest_user;