/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PMS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SM_SALPRICELIST_L', 'T_SM_SALPRICELIST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SPLCUSENTRY', 'T_SM_SPLCUSENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SALPRICELISTGROUP', 'T_SM_SALPRICELISTGROUP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SALPRICELISTGROUP_L', 'T_SM_SALPRICELISTGROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SPLENTRY_L', 'T_SM_SPLENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_SPLENTRY_L_FENTRYID') CREATE INDEX IDX_SM_SPLENTRY_L_FENTRYID ON T_SM_SPLENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_SM_SALPRICELIST', 'T_SM_SALPRICELIST', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SPLENTRY', 'T_SM_SPLENTRY', 'FENTRYID', '1';

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



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