Share via


DacServices.ImportBacpac Method

Definition

Overloads

ImportBacpac(BacPackage, String, DacImportOptions, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

ImportBacpac(BacPackage, String, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

ImportBacpac(BacPackage, String, DacAzureDatabaseSpecification, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

ImportBacpac(BacPackage, String, DacImportOptions, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

public void ImportBacpac (Microsoft.SqlServer.Dac.BacPackage package, string targetDatabaseName, Microsoft.SqlServer.Dac.DacImportOptions importOptions, System.Threading.CancellationToken? cancellationToken = default);
member this.ImportBacpac : Microsoft.SqlServer.Dac.BacPackage * string * Microsoft.SqlServer.Dac.DacImportOptions * Nullable<System.Threading.CancellationToken> -> unit
Public Sub ImportBacpac (package As BacPackage, targetDatabaseName As String, importOptions As DacImportOptions, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)

Parameters

package
BacPackage

BacPackage containing schema to be deployed and data to be imported.

targetDatabaseName
String

Name of the target database for deployment.

importOptions
DacImportOptions

Instance of DacImportOptions that specifies properties that affect various aspects of the import.

cancellationToken
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.

Exceptions

If the value for any of the required parameters is a null reference or an empty string.

If an error occurs during schema deployment and data import.

If the CancellationToken has a cancellation requested and the operation could be cancelled.

Applies to

ImportBacpac(BacPackage, String, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

public void ImportBacpac (Microsoft.SqlServer.Dac.BacPackage package, string targetDatabaseName, System.Threading.CancellationToken? cancellationToken = default);
member this.ImportBacpac : Microsoft.SqlServer.Dac.BacPackage * string * Nullable<System.Threading.CancellationToken> -> unit
Public Sub ImportBacpac (package As BacPackage, targetDatabaseName As String, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)

Parameters

package
BacPackage

BacPackage containing schema to be deployed and data to be imported.

targetDatabaseName
String

Name of the target database for deployment.

cancellationToken
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.

Exceptions

If the value for any of the required parameters is a null reference or an empty string.

If an error occurs during schema deployment and data import.

If the CancellationToken has a cancellation requested and the operation could be cancelled.

Applies to

ImportBacpac(BacPackage, String, DacAzureDatabaseSpecification, Nullable<CancellationToken>)

Deploy schema and import table data from the supplied package to a database.

public void ImportBacpac (Microsoft.SqlServer.Dac.BacPackage package, string targetDatabaseName, Microsoft.SqlServer.Dac.DacAzureDatabaseSpecification creationDefaults, System.Threading.CancellationToken? cancellationToken = default);
member this.ImportBacpac : Microsoft.SqlServer.Dac.BacPackage * string * Microsoft.SqlServer.Dac.DacAzureDatabaseSpecification * Nullable<System.Threading.CancellationToken> -> unit
Public Sub ImportBacpac (package As BacPackage, targetDatabaseName As String, creationDefaults As DacAzureDatabaseSpecification, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)

Parameters

package
BacPackage

BacPackage containing schema to be deployed and data to be imported.

targetDatabaseName
String

Name of the target database for deployment.

creationDefaults
DacAzureDatabaseSpecification

Optional default size and edition parameters used when creating a new Azure database.

cancellationToken
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.

Exceptions

If the value for any of the required parameters is a null reference or an empty string.

If an error occurs during schema deployment and data import.

If the CancellationToken has a cancellation requested and the operation could be cancelled.

Applies to