Share via


DacServices.Extract Method

Definition

Overloads

Extract(Stream, String, String, Version, String, IEnumerable<Tuple<String,String>>, DacExtractOptions, Nullable<CancellationToken>)

Extract the schema from a database into a package.

Extract(String, String, String, Version, String, IEnumerable<Tuple<String,String>>, DacExtractOptions, Nullable<CancellationToken>)

Extract the schema from a database into a package.

Extract(Stream, String, String, Version, String, IEnumerable<Tuple<String,String>>, DacExtractOptions, Nullable<CancellationToken>)

Extract the schema from a database into a package.

public void Extract (System.IO.Stream packageStream, string databaseName, string applicationName, Version applicationVersion, string applicationDescription = default, System.Collections.Generic.IEnumerable<Tuple<string,string>> tables = default, Microsoft.SqlServer.Dac.DacExtractOptions extractOptions = default, System.Threading.CancellationToken? cancellationToken = default);
member this.Extract : System.IO.Stream * string * string * Version * string * seq<string * string> * Microsoft.SqlServer.Dac.DacExtractOptions * Nullable<System.Threading.CancellationToken> -> unit
Public Sub Extract (packageStream As Stream, databaseName As String, applicationName As String, applicationVersion As Version, Optional applicationDescription As String = Nothing, Optional tables As IEnumerable(Of Tuple(Of String, String)) = Nothing, Optional extractOptions As DacExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)

Parameters

packageStream
Stream

Stream to which to write the package.

databaseName
String

Name of the source database.

applicationName
String

String identifier for the DAC application.

applicationVersion
Version

Version of the DAC application.

applicationDescription
String

Optional string summary of the DAC application.

tables
IEnumerable<Tuple<String,String>>

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, no data will be exported.

extractOptions
DacExtractOptions

Optional DacExtractOptions instance used to specify options that affect the behavior of package extraction.

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 applicationName is a null reference or empty string.

If a problem occurs during package extraction; or the supplied stream is not suitable for writing the package.

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

Applies to

Extract(String, String, String, Version, String, IEnumerable<Tuple<String,String>>, DacExtractOptions, Nullable<CancellationToken>)

Extract the schema from a database into a package.

public void Extract (string packageFileName, string databaseName, string applicationName, Version applicationVersion, string applicationDescription = default, System.Collections.Generic.IEnumerable<Tuple<string,string>> tables = default, Microsoft.SqlServer.Dac.DacExtractOptions extractOptions = default, System.Threading.CancellationToken? cancellationToken = default);
public void Extract (string targetPath, string databaseName, string applicationName, Version applicationVersion, string applicationDescription = default, System.Collections.Generic.IEnumerable<Tuple<string,string>> tables = default, Microsoft.SqlServer.Dac.DacExtractOptions extractOptions = default, System.Threading.CancellationToken? cancellationToken = default);
member this.Extract : string * string * string * Version * string * seq<string * string> * Microsoft.SqlServer.Dac.DacExtractOptions * Nullable<System.Threading.CancellationToken> -> unit
member this.Extract : string * string * string * Version * string * seq<string * string> * Microsoft.SqlServer.Dac.DacExtractOptions * Nullable<System.Threading.CancellationToken> -> unit
Public Sub Extract (packageFileName As String, databaseName As String, applicationName As String, applicationVersion As Version, Optional applicationDescription As String = Nothing, Optional tables As IEnumerable(Of Tuple(Of String, String)) = Nothing, Optional extractOptions As DacExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)
Public Sub Extract (targetPath As String, databaseName As String, applicationName As String, applicationVersion As Version, Optional applicationDescription As String = Nothing, Optional tables As IEnumerable(Of Tuple(Of String, String)) = Nothing, Optional extractOptions As DacExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing)

Parameters

packageFileNametargetPath
String

Path to the package file to be created.

databaseName
String

Name of the source database.

applicationName
String

String identifier for the DAC application.

applicationVersion
Version

Version of the DAC application.

applicationDescription
String

Optional string summary of the DAC application.

tables
IEnumerable<Tuple<String,String>>

Optional enumerable used to retrieve enumerator over set of tables for which reference data should be stored. 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, no reference data will be stored.

extractOptions
DacExtractOptions

Optional DacExtractOptions instance used to specify options that affect the behavior of package extraction.

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 applicationName is a null reference or empty string.

If a problem occurs during package extraction.

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

Applies to