/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_TEMPLATE_TAXTYPE', 'T_TCTB_TEMPLATE_TAXTYPE', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_CONFIGS', 'T_TCTB_DATASOURCE_CONFIGS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_CONFIGS_L', 'T_TCTB_DATASOURCE_CONFIGS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_ENTRY', 'T_TCTB_DATASOURCE_ENTRY', 'FENTRYID', '1';

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




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