/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\LOG_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_ARCHIVE' AND KSQL_COL_NAME ='FMODIFYBILLID') 
 ALTER TABLE T_LOG_ARCHIVE ADD (FMODIFYBILLID VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_ARCHIVE' AND KSQL_COL_NAME ='FMODIFYCONTENT') 
 ALTER TABLE T_LOG_ARCHIVE ADD (FMODIFYCONTENT NVARCHAR(510) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_ARCHIVE' AND KSQL_COL_NAME ='FMODIFYCONTENT_TAG') 
 ALTER TABLE T_LOG_ARCHIVE ADD (FMODIFYCONTENT_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_ARCHIVE' AND KSQL_COL_NAME ='FMODIFYFIELDS') 
 ALTER TABLE T_LOG_ARCHIVE ADD (FMODIFYFIELDS VARCHAR(1020) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_APP' AND KSQL_COL_NAME ='FMODIFYBILLID') 
 ALTER TABLE T_LOG_APP ADD (FMODIFYBILLID VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_APP' AND KSQL_COL_NAME ='FMODIFYCONTENT') 
 ALTER TABLE T_LOG_APP ADD (FMODIFYCONTENT NVARCHAR(510) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_APP' AND KSQL_COL_NAME ='FMODIFYCONTENT_TAG') 
 ALTER TABLE T_LOG_APP ADD (FMODIFYCONTENT_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LOG_APP' AND KSQL_COL_NAME ='FMODIFYFIELDS') 
 ALTER TABLE T_LOG_APP ADD (FMODIFYFIELDS VARCHAR(1020) DEFAULT ' ' NOT NULL );

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