java.lang.Object
org.odpi.openmetadata.adapters.connectors.resource.jdbc.ddl.mssql.MSSQLSchemaDDL

public class MSSQLSchemaDDL extends Object
Builds up the definition of a schema, its tables, columns, primary keys, foreign keys and comments, using Microsoft SQL Server's T-SQL dialect.

Two T-SQL differences from PostgreSQL's DDL drive most of the divergence from PostgreSQLSchemaDDL:
  • T-SQL has no "IF NOT EXISTS" clause on CREATE SCHEMA/CREATE TABLE/ALTER TABLE ADD COLUMN, so existence checks are built explicitly from sys.schemas/OBJECT_ID/COL_LENGTH.
  • T-SQL has no "COMMENT ON" statement - descriptions are recorded with the sys.sp_addextendedproperty stored procedure instead (the mechanism SQL Server Management Studio itself uses for object descriptions).
Table names passed to this class are expected to already be schema-qualified (eg "schemaName.tableName"), since - unlike PostgreSQL's currentSchema= JDBC URL parameter - Microsoft SQL Server has no equivalent way to set an unqualified name's default schema from the connection string.