Users Pricing

blog

home / developersection / blogs / difference between grant and with grant in sql server 2008 r2

Difference between GRANT and WITH GRANT in SQL Server 2008 R2

Vijay Shukla 10547 08 Apr 2013 Updated 18 Sep 2014

This blog provides an overview of the difference between GRANT and WITH GRANT using SQL Server 2008 R2.

GRANT and WITH GRANT:

The difference between GRANT and WITH GRANT options is very easy. For the GRANT, the username can’t GRANT the same permission to other users. On the other hand, in the case OF WITH GRANT, the UserId will be able to give the permission after receiving requests from other users.

Syntax for GRANT and WITH GRANT:
GRANT:

USE model;

GRANT VIEW ANY DATABASE TO UserId;

GO

WITH GRANT:

USE model;

GRANT VIEW ANY DATABASE TO UserId WITH GRANT OPTION;

GO

Vijay Shukla

Other