/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_MDS_DELIVERYDATA', 'T_MDS_DELIVERYDATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_DELIVERYDATA_M') CREATE INDEX IDX_MDS_DELIVERYDATA_M ON T_MDS_DELIVERYDATA ( FMATERIEL );


 EXEC P_ALTERPK 'PK_MDS_DELIVERYDATA_L', 'T_MDS_DELIVERYDATA_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_DELIVERYQUERYSET', 'T_MDS_DELIVERYQUERYSET', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_DELIVERYQUERYSET_L', 'T_MDS_DELIVERYQUERYSET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_RESOURCEENTRY', 'T_MDS_RESOURCEENTRY', 'FENTRYID', '1';

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



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
