Share via


Application.GetPackageRoles(String, String, String, String) Method

Definition

Returns the database roles that have read access and write access to the package. Database roles apply only to packages stored in the SQL Server msdb database.

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)

Parameters

serverName
String

Specify the name and instance of the server that contains the package.

packagePath
String

Specify the name of the package.

readerRole
String

Returns the roles with read access.

writerRole
String

Returns the roles with write access.

Examples

The following code example shows how to retrieve the package roles, assuming the variables have been set to reflect your specific server name, package path, and roles.

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)  

Applies to