/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BEI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BEI_BANKAGENTPAYBILL_L', 'T_BEI_BANKAGENTPAYBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_BANKAGENTPAYENTRY', 'T_BEI_BANKAGENTPAYENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_BANKAGENTPAYENTRY') CREATE INDEX IDX_BEI_BANKAGENTPAYENTRY ON T_BEI_BANKAGENTPAYENTRY ( FID ,FSOURCEENTRYID );


 EXEC P_ALTERPK 'PK_T_BEI_BANKPAYINGBILL_L', 'T_BEI_BANKPAYINGBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_BANKAGENTPAYBILL', 'T_BEI_BANKAGENTPAYBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_BANKAGENTPAYBILL') CREATE  CLUSTERED INDEX IDX_BEI_BANKAGENTPAYBILL ON T_BEI_BANKAGENTPAYBILL ( FBILLNO ,FBILLSTATUS );


 EXEC P_ALTERPK 'PK_T_BEI_BANKPAYINGBILL', 'T_BEI_BANKPAYINGBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_BANKPAYINGBILL') CREATE  CLUSTERED INDEX IDX_BEI_BANKPAYINGBILL ON T_BEI_BANKPAYINGBILL ( FBILLNO ,FBILLSTATUS );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BEI_constraint.sql **/
