/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_PEKRULE', 'T_TCTB_DATASOURCE_PEKRULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_DATASOURCE_PEKRULE') CREATE INDEX IDX_TCTB_DATASOURCE_PEKRULE ON T_TCTB_DATASOURCE_PEKRULE ( FNUMBER ,FGROUPFIELD );


 EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_PEKRULE_L', 'T_TCTB_DATASOURCE_PEKRULE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_DATASOURCE_PKRULES', 'T_TCTB_DATASOURCE_PKRULES', 'FPKID', '1';

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



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