
-- DROP TABLE tl_occupation;



CREATE TABLE tl_occupation (
    object_id int NOT NULL ,
    object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
    object_created_date datetime DEFAULT getdate() NOT NULL
    ,
    code varchar(4) NOT NULL,
    name varchar(250) NOT NULL,
    level varchar(200) NOT NULL,
    parent_occupation_id numeric(12)  NULL
    );



ALTER TABLE tl_occupation ADD    
    CONSTRAINT PK_tl_occupation PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_occupation_parent_occupation_id 
    ON tl_occupation (parent_occupation_id);
