다음을 통해 공유


TSqlModel.LoadFromDacpac Method

Definition

Overloads

LoadFromDacpac(Stream, ModelLoadOptions)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

LoadFromDacpac(String, ModelLoadOptions)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

LoadFromDacpac(Stream, ModelLoadOptions, CancellationToken)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

LoadFromDacpac(String, ModelLoadOptions, CancellationToken)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

LoadFromDacpac(Stream, ModelLoadOptions)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDacpac (System.IO.Stream dacpacStream, Microsoft.SqlServer.Dac.Model.ModelLoadOptions options);
static member LoadFromDacpac : System.IO.Stream * Microsoft.SqlServer.Dac.Model.ModelLoadOptions -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDacpac (dacpacStream As Stream, options As ModelLoadOptions) As TSqlModel

Parameters

dacpacStream
Stream

A stream that contains the serialized dacpac.

options
ModelLoadOptions

The ModelLoadOptions defining how the model should be loaded. For models to be analyzed in static code analysis, it's recommended that the LoadAsScriptBackedModel be set to true. This is important since some rules may not work as expected unless this is true.

Returns

Exceptions

If there are problems loading the package from the specified dacpacStream. This may occur if the package does not load correctly or if references required by the package are not found using the original path to the reference.

Applies to

LoadFromDacpac(String, ModelLoadOptions)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDacpac (string fileName, Microsoft.SqlServer.Dac.Model.ModelLoadOptions options);
static member LoadFromDacpac : string * Microsoft.SqlServer.Dac.Model.ModelLoadOptions -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDacpac (fileName As String, options As ModelLoadOptions) As TSqlModel

Parameters

fileName
String

File path to package.

options
ModelLoadOptions

The ModelLoadOptions defining how the model should be loaded. For models to be analyzed in static code analysis, it's recommended that the LoadAsScriptBackedModel be set to true. This is important since some rules may not work as expected unless this is true.

Returns

Exceptions

If there are problems loading the package from the specified fileName. This may occur if the package does not load correctly or if references required by the package are not found in either the same directory as the package, or using the original path to the reference.

Applies to

LoadFromDacpac(Stream, ModelLoadOptions, CancellationToken)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDacpac (System.IO.Stream dacpacStream, Microsoft.SqlServer.Dac.Model.ModelLoadOptions options, System.Threading.CancellationToken cancellationToken);
static member LoadFromDacpac : System.IO.Stream * Microsoft.SqlServer.Dac.Model.ModelLoadOptions * System.Threading.CancellationToken -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDacpac (dacpacStream As Stream, options As ModelLoadOptions, cancellationToken As CancellationToken) As TSqlModel

Parameters

dacpacStream
Stream

A stream that contains the serialized dacpac.

options
ModelLoadOptions

The ModelLoadOptions defining how the model should be loaded. For models to be analyzed in static code analysis, it's recommended that the LoadAsScriptBackedModel be set to true. This is important since some rules may not work as expected unless this is true.

cancellationToken
CancellationToken

A token used for cancelling model loading.

Returns

Exceptions

When the load operation is canceled.

If there are problems loading the package from the specified dacpacStream. This may occur if the package does not load correctly or if references required by the package are not found using the original path to the reference.

Applies to

LoadFromDacpac(String, ModelLoadOptions, CancellationToken)

Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDacpac (string fileName, Microsoft.SqlServer.Dac.Model.ModelLoadOptions options, System.Threading.CancellationToken cancellationToken);
static member LoadFromDacpac : string * Microsoft.SqlServer.Dac.Model.ModelLoadOptions * System.Threading.CancellationToken -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDacpac (fileName As String, options As ModelLoadOptions, cancellationToken As CancellationToken) As TSqlModel

Parameters

fileName
String

File path to package.

options
ModelLoadOptions

The ModelLoadOptions defining how the model should be loaded. For models to be analyzed in static code analysis, it's recommended that the LoadAsScriptBackedModel be set to true. This is important since some rules may not work as expected unless this is true.

cancellationToken
CancellationToken

A token used for cancelling model loading.

Returns

Exceptions

When the load operation is canceled.

If there are problems loading the package from the specified fileName. This may occur if the package does not load correctly or if references required by the package are not found in either the same directory as the package, or using the original path to the reference.

Applies to