/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG' AND KSQL_COL_NAME ='FLICENSESTATUS') 
 ALTER TABLE T_TCTB_ORG ADD (FLICENSESTATUS VARCHAR(30) DEFAULT 'A' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG' AND KSQL_COL_NAME ='FACTIVEUSERID') 
 ALTER TABLE T_TCTB_ORG ADD (FACTIVEUSERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG' AND KSQL_COL_NAME ='FCANCELUSERID') 
 ALTER TABLE T_TCTB_ORG ADD (FCANCELUSERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG' AND KSQL_COL_NAME ='FACTIVEDATE') 
 ALTER TABLE T_TCTB_ORG ADD (FACTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG' AND KSQL_COL_NAME ='FCANCELDATE') 
 ALTER TABLE T_TCTB_ORG ADD (FCANCELDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_LICENSE_FROM') 
 CREATE TABLE T_TCTB_LICENSE_FROM (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FUNIFIEDSOCIALCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FACTIVEUSERID BIGINT DEFAULT 0 NOT NULL,
FCANCELUSERID BIGINT DEFAULT 0 NOT NULL,
FACTIVEDATE DATETIME,
FCANCELDATE DATETIME,
FPASSWORD VARCHAR(100) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
