/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_CONFIG ADD (FNAME VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_USESTATUS' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_USESTATUS ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_USESTATUS' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_FA_USESTATUS ADD (FFULLNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_USESTATUS' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_FA_USESTATUS ADD (FREMARK NVARCHAR(255) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETCATEGORY' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_ASSETCATEGORY ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETCATEGORY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_FA_ASSETCATEGORY ADD (FREMARK NVARCHAR(255) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETCATEGORY' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_FA_ASSETCATEGORY ADD (FFULLNAME NVARCHAR(255) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_STOREPLACE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_STOREPLACE ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREUSE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_DEPREUSE ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGEMODE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_CHANGEMODE ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGEMODE' AND KSQL_COL_NAME ='FFULLNAME') 
 ALTER TABLE T_FA_CHANGEMODE ADD (FFULLNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_INVENTSCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_INVENTSCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETBOOK' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_ASSETBOOK ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPRESPLITSETUP' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_DEPRESPLITSETUP ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREMETHOD' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_DEPREMETHOD ADD (FNAME NVARCHAR(100) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREMETHOD' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_FA_DEPREMETHOD ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREMETHOD' AND KSQL_COL_NAME ='FFORMULA') 
 ALTER TABLE T_FA_DEPREMETHOD ADD (FFORMULA NCLOB DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREMETHOD' AND KSQL_COL_NAME ='FFORMULADYN') 
 ALTER TABLE T_FA_DEPREMETHOD ADD (FFORMULADYN NCLOB DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_MATERTOASSET' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_MATERTOASSET ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_INVENTSCHEMEENTRY' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_INVENTSCHEMEENTRY ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGETYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_FA_CHANGETYPE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );

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