Humble Trader

Wednesday, September 06, 2006

Table Create Script Template

-- ------------------------------------------------------------------------- --
-- --
-- Title: [table_name]_t.sql --
-- Author: Steve Roach --
-- Date: DD-MON-YYYY --
-- Version: 01.00 --
-- --
-- Description: Create table [TABLE_NAME]. --
-- --
-- History: --
-- --
-- Date Ver Author Description --
-- --------- ----- ------ -------------------------------------------------- --
-- DD-MON-YY 01.00 SRR First release --
-- --
-- ------------------------------------------------------------------------- --

DROP TABLE [table_name] CASCADE CONSTRAINTS
/

CREATE TABLE [table_name]
(
[column_1] [DATATYPE] [NOT] NULL
,[column_2] [DATATYPE] [NOT] NULL
CONSTRAINT [table_name]_c1
CHECK ([column_2] IN ('[OPTION_1]'
,'[OPTION_2]'
,...))
,...
)
/

COMMENT ON TABLE [table_name] IS 'Comment.'
/

COMMENT ON COLUMN [table_name].[column_1] IS 'comment.'
/

COMMENT ON COLUMN ...
/

0 Comments:

Post a Comment

<< Home