ModelLoadOptions Class
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.
Assembly: Microsoft.SqlServer.Dac.Extensions (in Microsoft.SqlServer.Dac.Extensions.dll)
| Name | Description | |
|---|---|---|
![]() | LoadAsScriptBackedModel | 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. |
![]() | ModelStorageType | Gets or sets the model stored in and a file-backed storage. |
![]() | ThrowOnModelErrors |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | ToString() | (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.

