What is the difference between GRANT and WITH GRANT when giving permissions to the user? This is a very interesting question recently asked me to during my session at TechMela Nepal.
Let us first see the syntax and analyze.
GRANT:
USE master;
GRANTÂ VIEW ANY DATABASEÂ TO username;
GO
WITH GRANT:
USE master;
GRANTÂ VIEW ANY DATABASEÂ TO username WITHÂ GRANTÂ OPTION;
GO
The difference between these options is very simple. In case of only GRANT, the username cannot grant the same permission to other users. On the other hand, with the option WITH GRANT, the username will be able to give the permission after receiving requests from other users.
This is a very basic definition of the subject. I would like to request my readers to come up with a working script to prove this scenario. Please submit your script to me by email (pinal ‘at’ sqlauthority.com), or in comment field.
Reference : Pinal Dave (https://blog.sqlauthority.com)