This documentation is archived and is not being maintained.

DacServices.ImportBacpac Method

 

Updated: April 20, 2017

Deploys schema and imports table data from the supplied package to a database.

Namespace:   Microsoft.SqlServer.Dac
Assembly:  Microsoft.SqlServer.Dac (in Microsoft.SqlServer.Dac.dll)

NameDescription
System_CAPS_pubmethodImportBacpac(BacPackage, String, DacAzureDatabaseSpecification, Nullable<CancellationToken>)

Deploys schema and imports table data from the supplied package to a database.

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

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

System_CAPS_pubmethodImportBacpac(BacPackage, String, Nullable<CancellationToken>)

Deploys schema and imports table data from the supplied package to a database.

Return to top

DacServices.ImportBacpac Method (BacPackage, String, DacAzureDatabaseSpecification, Nullable<CancellationToken>)

Deploys schema and imports table data from the supplied package to a database.

public void ImportBacpac(
	BacPackage package,
	string targetDatabaseName,
	DacAzureDatabaseSpecification creationDefaults,
	Nullable<CancellationToken> cancellationToken = null
)

Parameters

package
Type: Microsoft.SqlServer.Dac.BacPackage

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

targetDatabaseName
Type: System.String

The name of the target database for deployment.

creationDefaults
Type: Microsoft.SqlServer.Dac.DacAzureDatabaseSpecification

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

cancellationToken
Type: System.Nullable<CancellationToken>

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

Exception Condition
ArgumentException

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

DacServicesException

If an error occurs during schema deployment and data import.

OperationCanceledException

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

Return to top

DacServices.ImportBacpac Method (BacPackage, String, DacImportOptions, Nullable<CancellationToken>)

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

public void ImportBacpac(
	BacPackage package,
	string targetDatabaseName,
	DacImportOptions importOptions,
	Nullable<CancellationToken> cancellationToken = null
)

Parameters

package
Type: Microsoft.SqlServer.Dac.BacPackage

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

targetDatabaseName
Type: System.String

Name of the target database for deployment.

importOptions
Type: Microsoft.SqlServer.Dac.DacImportOptions

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

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

Exception Condition
ArgumentException

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

DacServicesException

If an error occurs during schema deployment and data import.

OperationCanceledException

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

Return to top

DacServices.ImportBacpac Method (BacPackage, String, Nullable<CancellationToken>)

Deploys schema and imports table data from the supplied package to a database.

public void ImportBacpac(
	BacPackage package,
	string targetDatabaseName,
	Nullable<CancellationToken> cancellationToken = null
)

Parameters

package
Type: Microsoft.SqlServer.Dac.BacPackage

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

targetDatabaseName
Type: System.String

The name of the target database for deployment.

cancellationToken
Type: System.Nullable<CancellationToken>

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

Exception Condition
ArgumentException

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

DacServicesException

If an error occurs during schema deployment and data import.

OperationCanceledException

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

Return to top
Show: