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)  

適用於