/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTS_ZONETYPE_L') 
 CREATE TABLE T_CTS_ZONETYPE_L (
FID BIGINT DEFAULT 0 NOT NULL,
FPKID VARCHAR(32) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(64) DEFAULT ' ' NOT NULL,
FUSAGE NVARCHAR(256) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTS_ZONETYPE') 
 CREATE TABLE T_CTS_ZONETYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(32) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS CHAR(32) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);

EXEC P_ALTERPK 'PK_T_CTS_ZONETYPE_L', 'T_CTS_ZONETYPE_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_CTS_ZY_L_FID') CREATE INDEX IDX_T_CTS_ZY_L_FID ON T_CTS_ZONETYPE_L ( FID );
 
EXEC P_ALTERPK 'PK_T_CTS_ZONETYPE', 'T_CTS_ZONETYPE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_CTS_ZONETYPE_FNUM') CREATE INDEX IDX_T_CTS_ZONETYPE_FNUM ON T_CTS_ZONETYPE ( FNUMBER );


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