/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFBPERIOD', 'T_EB_STRUCTOFBPERIOD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BPREIOD_MODEL') CREATE INDEX IDX_EB_BPREIOD_MODEL ON T_EB_STRUCTOFBPERIOD ( FMODELID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BPERIOD_LONGNUM') CREATE INDEX IDX_EB_BPERIOD_LONGNUM ON T_EB_STRUCTOFBPERIOD ( FLONGNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BPREIOD_DIM') CREATE INDEX IDX_EB_BPREIOD_DIM ON T_EB_STRUCTOFBPERIOD ( FDIMENSIONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BPREIOD_PARENT') CREATE INDEX IDX_EB_BPREIOD_PARENT ON T_EB_STRUCTOFBPERIOD ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_EB_STRUCTOFBPERIOD_L', 'T_EB_STRUCTOFBPERIOD_L', 'FPKID', '1';

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

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



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