Export (0) Print
Expand All

TSqlModel Class

Represents a model of a SQL Server database schema.

Object
  Microsoft.SqlServer.Dac.Model.TSqlModel

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

public sealed class TSqlModel : IDisposable

The TSqlModel type exposes the following members.

  NameDescription
Public methodTSqlModel(String)Loads a model from a DacPackage or BacPackage. This is equivalent to calling LoadFromDacpac(String, ModelLoadOptions) with default values.
Public methodTSqlModel(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 methodTSqlModel(SqlServerVersion, TSqlModelOptions)Creates an empty model that targets a specific SqlServerVersion
Top

  NameDescription
Public propertyCollationComparerComparer that can compare strings and ObjectIdentifiers using the collation of this TSqlModel. This can be very useful when comparing objects in the model since comparisons will be consistent with the expected comparison results in SQL Server
Public propertyDisplayServicesGets the DisplayServices that support producing display properties for objects in the model.
Public propertyIsScriptBackedIs this a model that is backed by scripts? In this case objects in the UserDefined scope will have source position information including a source name and information. This is important for scenarios such as use of the CodeAnalysisService. Any empty TSqlModel created will be script backed by default. Models loaded from a Dacpac will only be scipt backed if the LoadAsScriptBackedModel option is enabled. Note that creating a script backed model will take longer than using a standard model loaded from a Dacpac
Public propertyVersionThe specific SQL Server release targeted by the model.
Top

  NameDescription
Public methodAddObjects(TSqlScript)Adds objects to the model based on the contents of a TSqlScript object. The script should be valid TSql with no parse errors. Objects added using this method cannot be updated or deleted at a later point as update/delete requires a script name to be specified when adding the objects. If this is a requirement use the AddOrUpdateObjects(TSqlScript, String, TSqlObjectOptions) method instead.
Public methodAddObjects(String)Adds objects to the model based on the contents of a TSql Script string. The script should consist of valid TSql DDL statements. Objects added using this method cannot be updated or deleted at a later point as update/delete requires a script name to be specified when adding the objects. If this is a requirement use the AddOrUpdateObjects(String, String, TSqlObjectOptions) method instead.
Public methodAddObjects(TSqlScript, TSqlObjectOptions)Add Objects to the model based on the contents of a TSqlScript object, plus additional metadata defined by a TSqlObjectOptions object The script should be valid TSql with no parse errors. Objects added using this method cannot be updated or deleted at a later point as update/delete requires a script name to be specified when adding the objects. If this is a requirement use the AddOrUpdateObjects(TSqlScript, String, TSqlObjectOptions) method instead.
Public methodAddObjects(String, TSqlObjectOptions)Add Objects to the model based on the contents of a TSql Script string, plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements. Objects added using this method cannot be updated or deleted at a later point as update/delete requires a script name to be specified when adding the objects. If this is a requirement use the AddOrUpdateObjects(String, String, TSqlObjectOptions) method instead.
Public methodAddOrUpdateObjects(TSqlScript, String, TSqlObjectOptions)Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSqlScript object plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.
Public methodAddOrUpdateObjects(String, String, TSqlObjectOptions)Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSql Script string plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.
Public methodCopyModelOptionsCopies the DatabaseOptions for the model to a TSqlModelOptions object. This is useful if you wish to duplicate the options for a model when creating a new model.
Public methodDeleteObjectsDeletes any objects that were added to the model with the specified sourceName.
Public methodDisposeReleases all resources used by the TSqlModel object.
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectReturns TSqlObjects of the specified objectTypetype and ididentity. Only top level ModelTypeClass types are supported by this method - the objectTypetype parameter must be in the types returned from the TopLevelTypes method or the call will fail.
Public methodGetObjects(DacQueryScopes, ModelTypeClass[])Returns all TSqlObjects matching the list of typeFilters. Only top level ModelTypeClass types are supported by this method - all types in the typeFilterstype parameter must be present in the TopLevelTypes or the call will fail.
Public methodGetObjects(ModelTypeClass, ObjectIdentifier, DacQueryScopes)Returns all TSqlObjects that match the ModelTypeClass and ObjectIdentifier. Only top level ModelTypeClass types are supported by this method - the objectTypetype parameter must be in the types returned from the TopLevelTypes method or the call will fail.
Public methodGetType (Inherited from Object.)
Public methodStatic memberLoadFromDacpac(Stream, ModelLoadOptions)Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.
Public methodStatic memberLoadFromDacpac(String, ModelLoadOptions)Loads a model from a DacPackage or BacPackage using the specified options to configure what kind of storage to use, and whether to load a script-backed model or not.
Public methodToString (Inherited from Object.)
Public methodValidateValidates the model and returns a list of messages with any errors/warnings.
Top

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

Community Additions

ADD
Show:
© 2014 Microsoft