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

定義

傳回具有封裝讀取權限和寫入權限的資料庫角色。 資料庫角色僅適用于儲存在 SQL Server msdb 資料庫中的封裝。

public:
 void GetPackageRoles(System::String ^ serverName, System::String ^ packagePath, [Runtime::InteropServices::Out] System::String ^ % readerRole, [Runtime::InteropServices::Out] System::String ^ % writerRole);
public void GetPackageRoles (string serverName, string packagePath, out string readerRole, out string writerRole);
member this.GetPackageRoles : string * string * string * string -> unit
Public Sub GetPackageRoles (serverName As String, packagePath As String, ByRef readerRole As String, ByRef writerRole As String)

參數

serverName
String

指定包含封裝的伺服器名稱和執行個體。

packagePath
String

指定封裝的名稱。

readerRole
String

傳回具有讀取存取權的角色。

writerRole
String

傳回具有寫入存取權的角色。

範例

下列程式碼範例示範如何取得封裝角色,假設變數已設定為反映您的特定伺服器名稱、封裝路徑和角色。

string readerRole = null;  
string writerRole = null;  
app.GetPackageRoles(myServerName, packagePath, out readerRole, out writerRole);  
Dim readerRole As String =  Nothing   
Dim writerRole As String =  Nothing   
app.GetPackageRoles(myServerName, packagePath, readerRole, writerRole)  

適用於