ModelExtractOptions.LoadAsScriptBackedModel Property

Definition

Should the model be loaded so that objects are backed up by scripted representations? 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(String, String, TSqlObjectOptions) 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.

public bool LoadAsScriptBackedModel { get; set; }
member this.LoadAsScriptBackedModel : bool with get, set
Public Property LoadAsScriptBackedModel As Boolean

Property Value

Remarks

Default value is false, since there is a performance hit involved in creating a script-backed model from a non-scripted source

Applies to