Partilhar via


Server.Grant Method

Grants the specified set of permissions to the specified grantees on the instance of Microsoft SQL Server.

Remarks

Updated text:

The Grant method has several overloads that give you a choice of whether to grant one or more permission to a single grantee or to several grantees. It also lets you specify whether the grantee has permission to give other users permission, and what role the grantee assumes when taking this action.

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Overload List

Name Description
Server.Grant (ServerPermissionSet, String)
Grants the specified set of permissions to the specified grantee on the instance of Microsoft SQL Server.
Server.Grant (ServerPermissionSet, String[])
Grants the specified set of permissions to the specified grantees on the instance of Microsoft SQL Server.
Server.Grant (ServerPermissionSet, String, Boolean)
Grants access to the specified permission to the grantee and the ability to grant access to other users on the instance of Microsoft SQL Server.
Server.Grant (ServerPermissionSet, String[], Boolean)
Grants access to the specified permission to the grantees and the ability to grant access to other users on the instance of Microsoft SQL Server.
Server.Grant (ServerPermissionSet, String, Boolean, String)
Grants the specified set of permissions to the grantee and the ability to grant the set of permissions to other users on the instance of Microsoft SQL Server under an assumed role.
Server.Grant (ServerPermissionSet, String[], Boolean, String)
Grants the specified set of permissions to the grantees and the ability to grant the set of permissions to other users on the instance of Microsoft SQL Server under an assumed role.

See Also

Reference

Server Class
Server Members
Microsoft.SqlServer.Management.Smo Namespace

Other Resources

How to: Grant Server Permissions in Visual Basic .NET
Granting, Revoking, and Denying Permissions
Managing Servers

Change History

Release

History

New content:
  • Added code sample to the Example section.