IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDERENTRY' AND KSQL_COL_NAME IN ('FPAYENTRYCHANGETYPE')) 
 ALTER TABLE T_PUR_ORDERENTRY ADD (FPAYENTRYCHANGETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME IN ('FCHANGESTATUS')) 
 ALTER TABLE T_PUR_ORDER_A ADD (FCHANGESTATUS CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME IN ('FCHANGERID')) 
 ALTER TABLE T_PUR_ORDER_A ADD (FCHANGERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME IN ('FCHANGEDATE')) 
 ALTER TABLE T_PUR_ORDER_A ADD (FCHANGEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME IN ('FSUBVERSION')) 
 ALTER TABLE T_PUR_ORDER_A ADD (FSUBVERSION NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME IN ('FVERSION')) 
 ALTER TABLE T_PUR_ORDER_A ADD (FVERSION NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FMFTORDERNUMBER')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FMFTORDERNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FMFTORDERENTRYSEQ')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FMFTORDERENTRYSEQ VARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FMFTORDERID')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FMFTORDERID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FMFTORDERENTRYID')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FMFTORDERENTRYID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FCONFIGUREDCODEID')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FPRODUCTTYPE')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FPRODUCTTYPE CHAR(1) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCK' AND KSQL_COL_NAME IN ('FREPLENISHTYPE'))
ALTER TABLE T_PUR_INSTOCK ADD (FREPLENISHTYPE CHAR(1) DEFAULT ' ' NOT NULL );