Share via


TSqlModel.LoadFromDatabase Method

Definition

Overloads

LoadFromDatabase(String, ModelExtractOptions, Nullable<CancellationToken>)

Loads a model from a database using the specified options.

LoadFromDatabase(String, SecureString, ModelExtractOptions, Nullable<CancellationToken>)

Loads a model from a database using the specified options.

LoadFromDatabase(String, ModelExtractOptions, Nullable<CancellationToken>)

Loads a model from a database using the specified options.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDatabase (string connectionString, Microsoft.SqlServer.Dac.Model.ModelExtractOptions options = default, System.Threading.CancellationToken? cancellationToken = default);
static member LoadFromDatabase : string * Microsoft.SqlServer.Dac.Model.ModelExtractOptions * Nullable<System.Threading.CancellationToken> -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDatabase (connectionString As String, Optional options As ModelExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing) As TSqlModel

Parameters

connectionString
String

A connection string specifying the database and catalog to load.

options
ModelExtractOptions

Optional ModelExtractOptions instance used to specify options that affect the behavior of package extraction. 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
Nullable<CancellationToken>

Optional cancellation token used to cancel a load operation.

Returns

Exceptions

If connectionString is null.

If connectionString is not a valid connection string or options.Storage is not a valid value of the enumerated type.

If there are problems extracting the model from the specified database.

Applies to

LoadFromDatabase(String, SecureString, ModelExtractOptions, Nullable<CancellationToken>)

Loads a model from a database using the specified options.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDatabase (string connectionString, System.Security.SecureString password, Microsoft.SqlServer.Dac.Model.ModelExtractOptions options = default, System.Threading.CancellationToken? cancellationToken = default);
static member LoadFromDatabase : string * System.Security.SecureString * Microsoft.SqlServer.Dac.Model.ModelExtractOptions * Nullable<System.Threading.CancellationToken> -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDatabase (connectionString As String, password As SecureString, Optional options As ModelExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing) As TSqlModel

Parameters

connectionString
String

A connection string specifying the database and catalog to load.

password
SecureString

This password string used when connecting to the specified database.

options
ModelExtractOptions

Optional ModelExtractOptions instance used to specify options that affect the behavior of package extraction. 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
Nullable<CancellationToken>

Optional cancellation token used to cancel a load operation.

Returns

Exceptions

If connectionString is null.

If connectionString is not a valid connection string or options.Storage is not a valid value of the enumerated type.

If there are problems extracting the model from the specified database.

Applies to