Export (0) Print
Expand All

DacServices.ExportBacpac Method (String, String, DacSchemaModelStorageType, IEnumerable<Tuple<String, String>>, Nullable<CancellationToken>)

Extracts schema and exports data from a database into a "bacpac" package.

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

public void ExportBacpac(
	string packageFileName,
	string databaseName,
	DacSchemaModelStorageType modelStorageType,
	IEnumerable<Tuple<string, string>> tables,
	Nullable<CancellationToken> cancellationToken
)

Parameters

packageFileName
Type: String
The path of the target package file.
databaseName
Type: String
The name of the source database.
modelStorageType
Type: Microsoft.SqlServer.Dac.DacSchemaModelStorageType
The type of backing storage for a schema model.
tables
Type: IEnumerable<Tuple<String, String>>
The optional enumerable used to retrieve enumerator over set of tables for which data should be exported. For each Tuple in the enumeration the first item specifies the schema of the table, and the second specifies the base identifier of the table. If the value for this parameter is a null reference, data for all tables will be exported.
cancellationToken
Type: 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.

ExceptionCondition
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 export; or if tables specifies a table that does not exist in the schema contained in the supplied package.

OperationCanceledException

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

Community Additions

ADD
Show:
© 2014 Microsoft