Deploys the supplied package to a database.
命名空间: Microsoft.SqlServer.Dac
程序集: Microsoft.SqlServer.Dac(在 Microsoft.SqlServer.Dac.dll 中)
语法
声明
Public Sub Deploy ( _
package As DacPackage, _
targetDatabaseName As String, _
upgradeExisting As Boolean, _
options As DacDeployOptions, _
cancellationToken As Nullable(Of CancellationToken) _
)
用法
Dim instance As DacServices
Dim package As DacPackage
Dim targetDatabaseName As String
Dim upgradeExisting As Boolean
Dim options As DacDeployOptions
Dim cancellationToken As Nullable(Of CancellationToken)
instance.Deploy(package, targetDatabaseName, _
upgradeExisting, options, cancellationToken)
public void Deploy(
DacPackage package,
string targetDatabaseName,
bool upgradeExisting,
DacDeployOptions options,
Nullable<CancellationToken> cancellationToken
)
public:
void Deploy(
DacPackage^ package,
String^ targetDatabaseName,
bool upgradeExisting,
DacDeployOptions^ options,
Nullable<CancellationToken> cancellationToken
)
member Deploy :
package:DacPackage *
targetDatabaseName:string *
upgradeExisting:bool *
options:DacDeployOptions *
cancellationToken:Nullable<CancellationToken> -> unit
public function Deploy(
package : DacPackage,
targetDatabaseName : String,
upgradeExisting : boolean,
options : DacDeployOptions,
cancellationToken : Nullable<CancellationToken>
)
参数
- package
类型:Microsoft.SqlServer.Dac.DacPackage
DacPackage containing schema to be deployed.
- targetDatabaseName
类型:System.String
Name of the target database for deployment.
- upgradeExisting
类型:System.Boolean
true to allow modification of existing database schema in order to match schema contained in source package; otherwise false to block modification of existing database. If the database does not exist this flag has no effect.
- options
类型:Microsoft.SqlServer.Dac.DacDeployOptions
Instance of DacDeployOptions that specifies properties that affect various aspects of the deployment.
- cancellationToken
类型:System.Nullable<CancellationToken>
Optional CancellationToken that can be used to indicate that the operation should be cancelled. Use of this object does not guarantee that the operation will be cancelled.
异常
异常 | 条件 |
---|---|
ArgumentException | If the value for any of the required parameters is a null reference or an empty string. |
DacServicesException | upgradeExisting |
OperationCanceledException |