Compartilhar via


Método Application.SetPackageRoles

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

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (em Microsoft.SqlServer.ManagedDTS.dll)

Sintaxe

'Declaração
Public Sub SetPackageRoles ( _
    serverName As String, _
    packagePath As String, _
    readerRole As String, _
    writerRole As String _
)
'Uso
Dim instance As Application 
Dim serverName As String 
Dim packagePath As String 
Dim readerRole As String 
Dim writerRole As String

instance.SetPackageRoles(serverName, _
    packagePath, readerRole, writerRole)
public void SetPackageRoles(
    string serverName,
    string packagePath,
    string readerRole,
    string writerRole
)
public:
void SetPackageRoles(
    String^ serverName, 
    String^ packagePath, 
    String^ readerRole, 
    String^ writerRole
)
member SetPackageRoles : 
        serverName:string * 
        packagePath:string * 
        readerRole:string * 
        writerRole:string -> unit
public function SetPackageRoles(
    serverName : String, 
    packagePath : String, 
    readerRole : String, 
    writerRole : String
)

Parâmetros

  • serverName
    Tipo: System.String
    Specify the name and instance of the server that contains the package.
  • packagePath
    Tipo: System.String
    Specify the name of the package.
  • readerRole
    Tipo: System.String
    Specify a role to have read access.
  • writerRole
    Tipo: System.String
    Specify a role to have write access.

Exemplos

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

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

Consulte também

Referência

Application Classe

Namespace Microsoft.SqlServer.Dts.Runtime