Share via


Application.SetPackageRoles(String, String, String, String) 方法

定义

设置对包具有读和写访问权限的数据库角色。 数据库角色仅适用于存储在 SQL Server msdb 数据库中的包。

public:
 void SetPackageRoles(System::String ^ serverName, System::String ^ packagePath, System::String ^ readerRole, System::String ^ writerRole);
public void SetPackageRoles (string serverName, string packagePath, string readerRole, string writerRole);
member this.SetPackageRoles : string * string * string * string -> unit
Public Sub SetPackageRoles (serverName As String, packagePath As String, readerRole As String, writerRole As String)

参数

serverName
String

指定包含此包的服务器的名称和实例。

packagePath
String

指定包的名称。

readerRole
String

指定具有读取权限的角色。

writerRole
String

指定具有写入权限的角色。

示例

下面的代码示例演示如何设置包角色,假设变量已设置为反映特定的服务器名称、包路径和角色。

app.SetPackageRoles(serverName, packagePath, readerRole, writerRole);   
app.SetPackageRoles(serverName, packagePath, readerRole, writerRole)  

适用于