/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BEI_PROXYBANK', 'T_BEI_PROXYBANK', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_PROXYBANK') CREATE  CLUSTERED INDEX IDX_BEI_PROXYBANK ON T_BEI_PROXYBANK ( FENABLE );


 EXEC P_ALTERPK 'PK_T_BEI_PROXYBANK_L', 'T_BEI_PROXYBANK_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_PROXYBANK_L') CREATE INDEX IDX_BEI_PROXYBANK_L ON T_BEI_PROXYBANK_L ( FNAME ,FCOMMENT ,FID );


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANFIELD', 'T_BEI_CROSSTRANFIELD', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_CROSSTRANFIELD') CREATE  CLUSTERED INDEX IDX_BEI_CROSSTRANFIELD ON T_BEI_CROSSTRANFIELD ( FENABLE );


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANFIELD_L', 'T_BEI_CROSSTRANFIELD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_CROSSTRANFIELD_L') CREATE INDEX IDX_BEI_CROSSTRANFIELD_L ON T_BEI_CROSSTRANFIELD_L ( FID ,FNAME ,FCOMMENT );


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANTYPE', 'T_BEI_CROSSTRANTYPE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BEI_CROSSTRANTYPE') CREATE  CLUSTERED INDEX IDX_T_BEI_CROSSTRANTYPE ON T_BEI_CROSSTRANTYPE ( FENABLE );


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANTYPE_COU', 'T_BEI_CROSSTRANTYPE_COU', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANTYPE_CUR', 'T_BEI_CROSSTRANTYPE_CUR', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANTYPE_ENTRY', 'T_BEI_CROSSTRANTYPE_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_CROSSTRANTYPE_L', 'T_BEI_CROSSTRANTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_CROSSTRANTYPE_L') CREATE INDEX IDX_BEI_CROSSTRANTYPE_L ON T_BEI_CROSSTRANTYPE_L ( FID ,FNAME ,FCOMMENT );



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