/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSDOWN_ENTRY', 'T_BEI_BANKTRANSDOWN_ENTRY', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSDOWN_ENTRY') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSDOWN_ENTRY ON T_BEI_BANKTRANSDOWN_ENTRY ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSDOWNBILL', 'T_BEI_BANKTRANSDOWNBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSDOWNBILL') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSDOWNBILL ON T_BEI_BANKTRANSDOWNBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSDOWNBILL_L', 'T_BEI_BANKTRANSDOWNBILL_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSDOWNBILL_L') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSDOWNBILL_L ON T_BEI_BANKTRANSDOWNBILL_L ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSUP_ENTRY', 'T_BEI_BANKTRANSUP_ENTRY', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSUP_ENTRY') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSUP_ENTRY ON T_BEI_BANKTRANSUP_ENTRY ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSUPBILL', 'T_BEI_BANKTRANSUPBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSUPBILL') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSUPBILL ON T_BEI_BANKTRANSUPBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_BEI_BANKTRANSUPBILL_L', 'T_BEI_BANKTRANSUPBILL_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_BANKTRANSUPBILL_L') CREATE  CLUSTERED INDEX IDX_T_BEI_BANKTRANSUPBILL_L ON T_BEI_BANKTRANSUPBILL_L ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT', 'T_BEI_UPDATEPAYSTAT', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT ON T_BEI_UPDATEPAYSTAT ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT_ENTRY', 'T_BEI_UPDATEPAYSTAT_ENTRY', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT_ENTRY') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT_ENTRY ON T_BEI_UPDATEPAYSTAT_ENTRY ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT_L', 'T_BEI_UPDATEPAYSTAT_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT_L') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT_L ON T_BEI_UPDATEPAYSTAT_L ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT_LK', 'T_BEI_UPDATEPAYSTAT_LK', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT_LK') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT_LK ON T_BEI_UPDATEPAYSTAT_LK ( FID );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT_TC', 'T_BEI_UPDATEPAYSTAT_TC', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT_TC') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT_TC ON T_BEI_UPDATEPAYSTAT_TC ( FTBILLID );


 EXEC P_ALTERPK 'PK_T_BEI_UPDATEPAYSTAT_WB', 'T_BEI_UPDATEPAYSTAT_WB', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_UPDATEPAYSTAT_WB') CREATE  CLUSTERED INDEX IDX_T_BEI_UPDATEPAYSTAT_WB ON T_BEI_UPDATEPAYSTAT_WB ( FID );


 EXEC P_ALTERPK 'PK_BEI_UPDATEPAYSTAT_ENTRY_LK', 'T_BEI_UPDATEPAYSTAT_ENTRY_LK', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_UPDATEPAYSTAT_ET_LK') CREATE  CLUSTERED INDEX IDX_BEI_UPDATEPAYSTAT_ET_LK ON T_BEI_UPDATEPAYSTAT_ENTRY_LK ( FENTRYID );



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