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

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


 EXEC P_ALTERPK 'PK_T_BEI_TEMPLATE_L', 'T_BEI_TEMPLATE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BEI_TEMPLATEASSIGN', 'T_BEI_TEMPLATEASSIGN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_TEMPLATEASSIGN') CREATE INDEX IDX_BEI_TEMPLATEASSIGN ON T_BEI_TEMPLATEASSIGN ( FTEMPLATEID );


 EXEC P_ALTERPK 'PK_T_BEI_TEMPLATEASSIGN_L', 'T_BEI_TEMPLATEASSIGN_L', 'FPKID', '1';

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



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