-- 优先级类型加字段。
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PRIORITYENTRY' AND KSQL_COL_NAME ='FPRIORITYDEFINE') 
ALTER TABLE T_MRP_PRIORITYENTRY ADD (FPRIORITYDEFINE NVARCHAR(50) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PRIORITYENTRY' AND KSQL_COL_NAME ='FELEMENTFIELD') 
ALTER TABLE T_MRP_PRIORITYENTRY ADD (FELEMENTFIELD NVARCHAR(300) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PRIORITYENTRY' AND KSQL_COL_NAME ='FELEMENTVAL') 
ALTER TABLE T_MRP_PRIORITYENTRY ADD (FELEMENTVAL NVARCHAR(300) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PRIORITYENTRY' AND KSQL_COL_NAME ='FSORT') 
ALTER TABLE T_MRP_PRIORITYENTRY ADD (FSORT NVARCHAR(50) DEFAULT ' ' NOT NULL);