ModelLoadOptions Class

SQL Server 2014
 

Updated: April 20, 2017

Represents the options for loading a model from a data source such as a Dacpac file. These options can be very important depending on the scenario. For instance when running static code analysis using the CodeAnalysisService it is strongly recommended that the LoadAsScriptBackedModel option be set to true, as many rules expect a fully scripted source and may not operate as expected on a non-script backed model.

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

System::Object
  Microsoft.SqlServer.Dac.Model::ModelLoadOptions

public ref class ModelLoadOptions sealed 

NameDescription
System_CAPS_pubpropertyLoadAsScriptBackedModel

Gets or sets a value that indicates whether the model is loaded and the objects are backed up by scripted representationsl. In this case objects in the UserDefined scope will have a source name and source position information. When loading from a Dacpac or any other non-scripted source the model will not have source information. This means that when running static code analysis using the CodeAnalysisService some rules may not work correctly, and that existing objects in the model could not be replaced using the AddOrUpdateObjects method since there is no script with their original definition. For scenarios that use the CodeAnalysisService setting this to true is strongly recommended. Similarly if you wish to update existing objects in the model setting this to true may be useful. Note that there is a potentially significant performance cost involved in creating a scripted model. All top level objects in the UserDefined scope will be scripted out as strings and then replaced with their scripted representations, after which the model will then have to fully resolve all relationships. This will cause a one-time performance hit at the time the model is loaded.

System_CAPS_pubpropertyModelStorageType

Gets or sets the model stored in and a file-backed storage.

System_CAPS_pubpropertyThrowOnModelErrors

NameDescription
System_CAPS_pubmethodEquals(Object^)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Community Additions

ADD
Show: