/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BEI_ELECTICDIRCONSET_L', 'T_BEI_ELECTICDIRCONSET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RESPONSERULESET', 'T_BEI_RESPONSERULESET', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RESPONSERULESET_L', 'T_BEI_RESPONSERULESET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RESPRULESETENTRY', 'T_BEI_RESPRULESETENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_ELECTICDIRCONSET', 'T_BEI_ELECTICDIRCONSET', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RECEIVABLEHANDLE', 'T_BEI_RECEIVABLEHANDLE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_RECEIVABLEHANDLE') CREATE INDEX IDX_BEI_RECEIVABLEHANDLE ON T_BEI_RECEIVABLEHANDLE ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_BEI_RECEIVABLEHANDLE_L', 'T_BEI_RECEIVABLEHANDLE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RECEIVABLEHANDLEENT', 'T_BEI_RECEIVABLEHANDLEENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_RECEIVABLEHANDLE_E', 'T_BEI_RECEIVABLEHANDLE_E', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_RECEIVABLEHANDLE_E') CREATE INDEX IDX_BEI_RECEIVABLEHANDLE_E ON T_BEI_RECEIVABLEHANDLE_E ( FINVOICENUMBER );


 EXEC P_ALTERPK 'PK_T_BEI_RECEIVABLEHANDLE_F', 'T_BEI_RECEIVABLEHANDLE_F', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_RECEIVABLEHANDLE_F') CREATE INDEX IDX_BEI_RECEIVABLEHANDLE_F ON T_BEI_RECEIVABLEHANDLE_F ( FOPSTATUS );



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