Share via


TSqlModel Constructors

Definition

Overloads

TSqlModel(String)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values.

TSqlModel(SqlServerVersion, TSqlModelOptions)

Creates an empty model that targets a specific SqlServerVersion

TSqlModel(String, DacSchemaModelStorageType)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values for everything except the modelStorageType.

TSqlModel(String, DacSchemaModelStorageType, CancellationToken)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values for everything except the modelStorageType.

TSqlModel(String)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values.

public TSqlModel (string fileName);
new Microsoft.SqlServer.Dac.Model.TSqlModel : string -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Sub New (fileName As String)

Parameters

fileName
String

File path to package.

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.

Remarks

By default DacSchemaModelStorageType.Memory is used for the model storage format. The dacpac model will not be script-backed as the LoadAsScriptBackedModel will be set to false. Using LoadFromDacpac(String, ModelLoadOptions) with LoadAsScriptBackedModel set to true is recommended if the model will be used by the CodeAnalysisService for static code analysis.

Applies to

TSqlModel(SqlServerVersion, TSqlModelOptions)

Creates an empty model that targets a specific SqlServerVersion

public TSqlModel (Microsoft.SqlServer.Dac.Model.SqlServerVersion modelTargetVersion, Microsoft.SqlServer.Dac.Model.TSqlModelOptions modelCreationOptions);
new Microsoft.SqlServer.Dac.Model.TSqlModel : Microsoft.SqlServer.Dac.Model.SqlServerVersion * Microsoft.SqlServer.Dac.Model.TSqlModelOptions -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Sub New (modelTargetVersion As SqlServerVersion, modelCreationOptions As TSqlModelOptions)

Parameters

modelTargetVersion
SqlServerVersion

The version of SQL Server to target

modelCreationOptions
TSqlModelOptions

Options defining model properties, including the collation and how to store the model (in memory or file backed)

Applies to

TSqlModel(String, DacSchemaModelStorageType)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values for everything except the modelStorageType.

public TSqlModel (string fileName, Microsoft.SqlServer.Dac.DacSchemaModelStorageType modelStorageType);
new Microsoft.SqlServer.Dac.Model.TSqlModel : string * Microsoft.SqlServer.Dac.DacSchemaModelStorageType -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Sub New (fileName As String, modelStorageType As DacSchemaModelStorageType)

Parameters

fileName
String

File path to package.

modelStorageType
DacSchemaModelStorageType

Backing storage type for package instance.

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.

Remarks

The dacpac model will not be script-backed as the LoadAsScriptBackedModel will be set to false. Using LoadFromDacpac(String, ModelLoadOptions) with LoadAsScriptBackedModel set to true is recommended if the model will be used by the CodeAnalysisService for static code analysis.

Applies to

TSqlModel(String, DacSchemaModelStorageType, CancellationToken)

Loads a model from a DacPackage or BacPackage.

This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values for everything except the modelStorageType.

public TSqlModel (string fileName, Microsoft.SqlServer.Dac.DacSchemaModelStorageType modelStorageType, System.Threading.CancellationToken cancellationToken);
new Microsoft.SqlServer.Dac.Model.TSqlModel : string * Microsoft.SqlServer.Dac.DacSchemaModelStorageType * System.Threading.CancellationToken -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Sub New (fileName As String, modelStorageType As DacSchemaModelStorageType, cancellationToken As CancellationToken)

Parameters

fileName
String

File path to package.

modelStorageType
DacSchemaModelStorageType

Backing storage type for package instance.

cancellationToken
CancellationToken

A token used for cancelling model loading.

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.

When the load operation is canceled.

Remarks

The dacpac model will not be script-backed as the LoadAsScriptBackedModel will be set to false. Using LoadFromDacpac(String, ModelLoadOptions) with LoadAsScriptBackedModel set to true is recommended if the model will be used by the CodeAnalysisService for static code analysis.

Applies to