/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_CTS_NAMECONFIG', 'T_CTS_NAMECONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_CTS_NAMECONFIG_L', 'T_CTS_NAMECONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTS_NAMECONFIG_L_FID') CREATE INDEX IDX_CTS_NAMECONFIG_L_FID ON T_CTS_NAMECONFIG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_CTS_NAMECONFIGCOUNTRY', 'T_CTS_NAMECONFIGCOUNTRY', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_CTS_NAMECFGCY_FID') CREATE INDEX IDX_T_CTS_NAMECFGCY_FID ON T_CTS_NAMECONFIGCOUNTRY ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_CTS_NAMECONFIGFORMAT', 'T_CTS_NAMECONFIGFORMAT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTS_NAMECFGFORMAT_FID') CREATE INDEX IDX_CTS_NAMECFGFORMAT_FID ON T_CTS_NAMECONFIGFORMAT ( FID );


 EXEC P_ALTERPK 'PK_CTS_NAMECONFIGSTRUCT', 'T_CTS_NAMECONFIGSTRUCT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTS_NAMECFGSTRUCT_FID') CREATE INDEX IDX_CTS_NAMECFGSTRUCT_FID ON T_CTS_NAMECONFIGSTRUCT ( FID );


 EXEC P_ALTERPK 'PK_CTS_NAMEPREFIELD', 'T_CTS_NAMEPREFIELD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_CTS_NAMEPREFIELD_L', 'T_CTS_NAMEPREFIELD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTS_NAMEPREFIELD_L_FID') CREATE INDEX IDX_CTS_NAMEPREFIELD_L_FID ON T_CTS_NAMEPREFIELD_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_CTS_NAMETEXTCONFIG', 'T_CTS_NAMETEXTCONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_CTS_NAMETEXTCONFIG_L', 'T_CTS_NAMETEXTCONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTS_NAMETEXTCFG_L_FID') CREATE INDEX IDX_CTS_NAMETEXTCFG_L_FID ON T_CTS_NAMETEXTCONFIG_L ( FID ,FLOCALEID );


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