Class MSSQLSchemaDDL
java.lang.Object
org.odpi.openmetadata.adapters.connectors.resource.jdbc.ddl.mssql.MSSQLSchemaDDL
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
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_addextendedpropertystored procedure instead (the mechanism SQL Server Management Studio itself uses for object descriptions).
currentSchema= JDBC URL parameter - Microsoft SQL Server has no equivalent way to
set an unqualified name's default schema from the connection string.-
Constructor Summary
ConstructorsConstructorDescriptionMSSQLSchemaDDL(String schemaName, String schemaDescription, List<MSSQLTable> tables) -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of DDL statements to define the schema.
-
Constructor Details
-
MSSQLSchemaDDL
public MSSQLSchemaDDL(String schemaName, String schemaDescription, List<MSSQLTable> tables) throws InvalidParameterException - Throws:
InvalidParameterException
-
-
Method Details
-
getDDLStatements
Returns the list of DDL statements to define the schema.- Returns:
- list of statements
-