Data Control Language Commands in SQL Server

Grant:

Grants permission on a securable to a principal.

Syntax:

GRANT { ALL [ PRIVILEGES ] } | permission [ ( column [ ,...n ] ) ] [ ,...n ] [ ON [class :: ] securable ] TO principal ,...n ] [ WITH GRANT OPTION ] [ AS principal ]

Example:
Refer: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/a760c16a-4d2d-43f2-be81-ae9315f38185.htm (Online SQL Server Help)

Deny:

Denies a permission to a principal. Prevents that principal from inheriting the permission through its group or role memberships.

Syntax:

DENY { ALL [ PRIVILEGES ] }| permission [ ( column [ ,...n ] ) ] [ ,...n ][ ON [ class :: ] securable ] TO principal [ ,...n ] [CASCADE] [ AS principal ]

Example:
Refer: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/c32d1e01-9ee9-4665-a516-fcfece58078e.htm

Revoke:

Revokes a previously granted or denied permission.

Syntax:

REVOKE [ GRANT OPTION FOR ]
{
[ ALL [ PRIVILEGES ] ] | permission [ ( column [ ,...n ] ) ] [ ,...n ]
}
[ ON [ class :: ] securable ] { TO | FROM } principal [ ,...n ]
[ CASCADE] [ AS principal ]

Example:
Refer: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/9d31d3e7-0883-45cd-bf0e-f0361bbb0956.htm

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

  • Recent Posts

    • 450,717 hits
  • Join 37 other followers

  • Archives

  • Categories

  • April 2011
    M T W T F S S
    « Mar   May »
     123
    45678910
    11121314151617
    18192021222324
    252627282930  
  • Advertisements
%d bloggers like this: