/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MDS_SALORDERSG', 'T_MDS_SALORDERSG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_SALORDERSG_L', 'T_MDS_SALORDERSG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_SALORDERST', 'T_MDS_SALORDERST', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_SALORDERST') CREATE INDEX IDX_MDS_SALORDERST ON T_MDS_SALORDERST ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_MDS_SALORDERST_L', 'T_MDS_SALORDERST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_SALORDPLAN', 'T_MDS_SALORDPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_SALORDPLAN') CREATE INDEX IDX_MDS_SALORDPLAN ON T_MDS_SALORDPLAN ( FBILLNO ,FORGID );



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