/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PAY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PAY_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PAYAPPLY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PAYAPPLY_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIVE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECEIVE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ADJUST_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ADJUST_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTSTOCK_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTSTOCK_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTTRAN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTTRAN_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PLAN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PLAN_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_MESSAGE' AND KSQL_COL_NAME ='FTITLE') 
 ALTER TABLE T_PUR_MESSAGE ADD (FTITLE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_MESSAGE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_MESSAGE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SETTLE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SETTLE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_QUOTE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_QUOTE_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECRUIT_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECRUIT_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTRETURN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTRETURN_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REPLENISH_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REPLENISH_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPPLIERCHG_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SUPPLIERCHG_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONTRACT_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CONTRACT_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONCHANGE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CONCHANGE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPLY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APPLY_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALRETURN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SALRETURN_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALOUTSTOCK_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SALOUTSTOCK_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPT_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECEIPT_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SRMHELP' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_SRMHELP ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SRMHELP' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SRMHELP ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHKSCHEME_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CHKSCHEME_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOGSUPPLIER' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_LOGSUPPLIER ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOGSUPPLIER' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_LOGSUPPLIER ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOCATION' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_LOCATION ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOCATION' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_LOCATION ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PROJECT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_PROJECT ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PROJECT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PROJECT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ITEM' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_ITEM ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ITEM' AND KSQL_COL_NAME ='FCONTENT') 
 ALTER TABLE T_PUR_ITEM ADD (FCONTENT NVARCHAR(500) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ITEM' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ITEM ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_WAREHOUSE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_WAREHOUSE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_WAREHOUSE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_WAREHOUSE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_WAREHOUSE' AND KSQL_COL_NAME ='FADDRESS') 
 ALTER TABLE T_PUR_WAREHOUSE ADD (FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZGROUP' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_BIZGROUP ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZGROUP' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_PUR_BIZGROUP ADD (FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZGROUP' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_BIZGROUP ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_LOT ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_LOT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_LOT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_DISCOUNT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_DISCOUNT ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_DISCOUNT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_DISCOUNT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SOURCE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_SOURCE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SOURCE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SOURCE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PRICE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_PRICE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PRICE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PRICE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTUSER' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EXTUSER ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTUSER' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EXTUSER ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APIPLUGINCONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_APIPLUGINCONFIG ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APIPLUGINCONFIG' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APIPLUGINCONFIG ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPBIZPERSON' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_SUPBIZPERSON ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPBIZPERSON' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SUPBIZPERSON ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APTITUDE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APTITUDE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPROVE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APPROVE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CATEGORYCHG_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CATEGORYCHG_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_MATERIAL_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_MATERIAL_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SAMPLE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SAMPLE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPPLIERQUIT_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SUPPLIERQUIT_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ENTERTYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_ENTERTYPE ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ENTERTYPE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ENTERTYPE ADD (FREMARK NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SAMPLENOTIFY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SAMPLENOTIFY_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_NOTICE_A' AND KSQL_COL_NAME ='FTITLE') 
 ALTER TABLE T_PUR_NOTICE_A ADD (FTITLE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_NOTICE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_NOTICE_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RETURN_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APISERVICE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_APISERVICE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APISERVICE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APISERVICE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APICONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_APICONFIG ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APICONFIG' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APICONFIG ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_QUALITY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_QUALITY_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCORE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_SCORE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCORE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SCORE ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_GRADE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_GRADE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_GRADE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_GRADE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTTYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EXTTYPE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTTYPE' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_PUR_EXTTYPE ADD (FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTTYPE' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_EXTTYPE ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAGRADE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EVAGRADE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAGRADE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EVAGRADE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_TRACE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_TRACE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_TRACE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_TRACE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INDEXCLASS' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_INDEXCLASS ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INDEXCLASS' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_PUR_INDEXCLASS ADD (FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INDEXCLASS' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_INDEXCLASS ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APISCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_APISCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXIAPI' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EXIAPI ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INDEX' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_INDEX ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INDEX' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INDEX ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_SCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCHEME' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SCHEME ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTDATA' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EXTDATA ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXTDATA' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EXTDATA ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BLACK_PERSON' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_BLACK_PERSON ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BLACK_PERSON' AND KSQL_COL_NAME ='FSOURCENAME') 
 ALTER TABLE T_PUR_BLACK_PERSON ADD (FSOURCENAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FSIMPLENAME') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FARTIFICIALPERSON') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FARTIFICIALPERSON NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FREGADDRESS') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FREGADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FADDRESS') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER_A' AND KSQL_COL_NAME ='FLINKMAN') 
 ALTER TABLE T_PUR_REGSUPPLIER_A ADD (FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_IMPROVE_A ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EXAMINE_A ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCK' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INSTOCK ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BLACK_COMPANY' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_BLACK_COMPANY ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BLACK_COMPANY' AND KSQL_COL_NAME ='FSOURCENAME') 
 ALTER TABLE T_PUR_BLACK_COMPANY ADD (FSOURCENAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCENE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SCENE_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPARE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_COMPARE_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPONENT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_COMPONENT ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPONENT' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_COMPONENT ADD (FDESCRIPTION NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPONENT' AND KSQL_COL_NAME ='FMULILANGTEXTFIELD') 
 ALTER TABLE T_PUR_COMPONENT ADD (FMULILANGTEXTFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPCONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_COMPCONFIG ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPCONFIG' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_COMPCONFIG ADD (FDESCRIPTION NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPGROUP' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_COMPGROUP ADD (FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPGROUP' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_PUR_COMPGROUP ADD (FFULLNAME NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPGROUP' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_PUR_COMPGROUP ADD (FDESCRIPTION NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_USER' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_USER ADD (FNAME NVARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_USER' AND KSQL_COL_NAME ='FENTERPRISE') 
 ALTER TABLE T_PUR_USER ADD (FENTERPRISE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ORDER_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REQUEST_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INQUIRY_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INQUIRY_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZPERSON' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_BIZPERSON ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZPERSON' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_BIZPERSON ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ORDCHANGE_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECK_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CHECK_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICE_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INVOICE_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APTITUDESTDCONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_APTITUDESTDCONFIG ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONTENTCONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_CONTENTCONFIG ADD (FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONTENTCONFIG' AND KSQL_COL_NAME ='FNOTE') 
 ALTER TABLE T_PUR_CONTENTCONFIG ADD (FNOTE NVARCHAR(512) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_PUR_CONTENTCONFIG_L', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAFACTOR' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EVAFACTOR ADD (FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RFICONTENT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_RFICONTENT ADD (FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAPLAN_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EVAPLAN_A ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILL_A' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_BIDBILL_A ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIVE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECEIVE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INVOICE ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PAYAPPLY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PAYAPPLY ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ADJUST' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ADJUST ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONCHANGE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CONCHANGE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTTRAN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTTRAN ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTSTOCK' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTSTOCK ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PLAN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PLAN ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPLY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APPLY ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPPLIERCHG' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SUPPLIERCHG ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PAY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_PAY ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_OUTRETURN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_OUTRETURN ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REPLENISH' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REPLENISH ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RETURN ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURN' AND KSQL_COL_NAME ='FSUPADDR') 
 ALTER TABLE T_PUR_RETURN ADD (FSUPADDR NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALOUTSTOCK' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SALOUTSTOCK ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECK' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CHECK ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPPLIERQUIT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SUPPLIERQUIT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CATEGORYCHG' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CATEGORYCHG ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SAMPLENOTIFY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SAMPLENOTIFY ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_QUALITY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_QUALITY ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ORDCHANGE ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDER' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_ORDER ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALRETURN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SALRETURN ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECEIPT ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_NOTICE' AND KSQL_COL_NAME ='FTITLE') 
 ALTER TABLE T_PUR_NOTICE ADD (FTITLE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_NOTICE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_NOTICE ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FSIMPLENAME') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FARTIFICIALPERSON') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FARTIFICIALPERSON NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FREGADDRESS') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FREGADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FADDRESS') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FLINKMAN') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_REQUEST ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FSUPADDR') 
 ALTER TABLE T_PUR_REQUEST ADD (FSUPADDR NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPROVE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APPROVE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPARE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_COMPARE ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INQUIRY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_INQUIRY ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_QUOTE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_QUOTE ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCENE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SCENE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_MATERIAL' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_MATERIAL ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SAMPLE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_SAMPLE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APTITUDE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_APTITUDE ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONTRACT' AND KSQL_COL_NAME ='FBILLNAME') 
 ALTER TABLE T_PUR_CONTRACT ADD (FBILLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CONTRACT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CONTRACT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHKSCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_CHKSCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHKSCHEME' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_CHKSCHEME ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECRUIT' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_RECRUIT ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECRUIT' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_RECRUIT ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILL' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_BIDBILL ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILL' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_BIDBILL ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAPLAN' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_PUR_EVAPLAN ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EVAPLAN' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EVAPLAN ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_IMPROVE ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE' AND KSQL_COL_NAME ='FSRCBILLNAME') 
 ALTER TABLE T_PUR_IMPROVE ADD (FSRCBILLNAME NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_PUR_EXAMINE ADD (FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE' AND KSQL_COL_NAME ='FSRCBILLNAME') 
 ALTER TABLE T_PUR_EXAMINE ADD (FSRCBILLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );

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