/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_constraint.sql **/
EXEC p_DropIdx 'IDX_BD_LOTMAXSERIAL_LOTRULE', 'T_BD_LOTMAXSERIAL';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_LOTMAXSERIAL' AND KSQL_INDNAME = 'IX_LOTMAX_RULEMATPROP') CREATE INDEX IX_LOTMAX_RULEMATPROP ON T_BD_LOTMAXSERIAL ( FLOTCODERULEID ,FMATERIALID ,FACCORDPROP );

 EXEC P_ALTERPK 'PK_T_BD_MATERIALINVLOTLOG', 'T_BD_MATERIALINVLOTLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_MATERIALINVLOTLOG' AND KSQL_INDNAME = 'INDEX_BD_MATERIALINVLOTLOG') CREATE INDEX INDEX_BD_MATERIALINVLOTLOG ON T_BD_MATERIALINVLOTLOG ( FMATERIELINVINFOID );



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