
EXEC P_ALTERPK 'PK_MSPLAN_LABEL_CUSTOM', 'T_MSPLAN_LABEL_CUSTOM', 'FID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDXS_MSPLAN_LABELCM_CREATE')  CREATE INDEX IDXS_MSPLAN_LABELCM_CREATE ON T_MSPLAN_LABEL_CUSTOM ( FCREATETIME);



EXEC P_ALTERPK 'PK_MSPLAN_LABEL_CUSTOM_L', 'T_MSPLAN_LABEL_CUSTOM_L', 'FPKID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDXS_MSPLAN_LABELCM_NAME')  CREATE INDEX IDXS_MSPLAN_LABELCM_NAME ON T_MSPLAN_LABEL_CUSTOM_L ( FNAME);