Icon SchemaObjects Table

Structure
CREATE TABLE "SchemaObjects"
(
"ParentName" VARCHAR(40) COLLATE "ANSI_CI",
"ParentType" VARCHAR(15) COLLATE "ANSI_CI",
"Name" VARCHAR(40) COLLATE "ANSI_CI",
"Type" VARCHAR(15) COLLATE "ANSI_CI",
"CreateSQL" CLOB COLLATE "ANSI_CI",
"PostCreateSQL" CLOB COLLATE "ANSI_CI",
"PreDropSQL" CLOB COLLATE "ANSI_CI",
"DropSQL" CLOB COLLATE "ANSI_CI"
)

CREATE INDEX "ParentName" ON "SchemaObjects"
("ParentName")

CREATE INDEX "ParentType" ON "SchemaObjects"
("ParentType")

CREATE INDEX "Name" ON "SchemaObjects"
("Name")

CREATE INDEX "Type" ON "SchemaObjects"
("Type")

Description
This table contains all objects in an ElevateDB database in their dependency-sensitive creation order. This table can be used to generate a script for creating/dropping all objects in a database in a manner that will not generate any dependency errors.

In order to generate a proper CREATE script, simply navigate this table from the first row to the last row, using the CreateSQL column for the CREATE SQL statements for each object. After this initial pass, navigate this table again from the first row to the last row, using the PostCreateSQL column for any remaining ALTER SQL statements that may exist for dealing with objects that contain mutual depdendencies between each other, such as the case with two tables that have foreign keys that refer to the other table.

Information If you wish to include populating tables with existing rows in your CREATE script, you should do so before including any PostCreateSQL statements that may exist.

In order to generate a proper DROP script, simply navigate this table in reverse order from the last row to the first row, using the PreDropSQL column for any ALTER SQL statements that may exist for dealing with objects that contain mutual dependencies between each other, and need to have these dependencies removed before the objects can be dropped. After this initial pass, navigate this table again in reverse order from the last row to the first row, using the DropSQL column for the DROP SQL statements for each object.

Information Sub-objects such as indexes and triggers for tables are not specified in this table. Because such objects are not dependency-sensitive, they can be created according to the order that they appear in in their corresponding system information table such as the Indexes and Triggers tables. Simply query these tables for a given parent table name to retrieve the list of sub-objects.

The ParentType and Type column values are as follows:

TypeDescription
TableThe object is a table
ViewThe object is a view
ProcedureThe object is a procedure
FunctionThe object is a function

Related DDL Statements
StatementDescription
CREATE TABLECreates a new table
CREATE TRIGGERCreates a new trigger
CREATE INDEXCreates a new index
CREATE VIEWCreates a new view
CREATE PROCEDURECreates a new procedure
CREATE FUNCTIONCreates a new function
DROP TABLEDrops an existing table
DROP TRIGGERDrops an existing trigger
DROP INDEXDrops an existing index
DROP VIEWDrops an existing view
DROP PROCEDUREDrops an existing procedure
DROP FUNCTIONDrops an existing function
Image