/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_RECEIVEDBILLENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_RECEIVEDBILLENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_RECEIVEDBILLENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_RECEIVEDBILLENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_RECEIVEDBILLENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_RECEIVEDBILLENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_RECEIVEDBILLENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_RECEIVEDBILLENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_LIQUIDATIONENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_LIQUIDATIONENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_LIQUIDATIONENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LIQUIDATIONENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_LIQUIDATIONENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSPLANENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_BUSPLANENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSPLANENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_BUSPLANENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSPLANENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_BUSPLANENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSPLANENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_BUSPLANENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_REVCFMBILLENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_REVCFMBILLENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_REVCFMBILLENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_REVCFMBILLENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_REVCFMBILLENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_REVCFMBILLENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_REVCFMBILLENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_REVCFMBILLENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLPLANENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_LOSSBILLPLANENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLPLANENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_LOSSBILLPLANENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLPLANENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_LOSSBILLPLANENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLPLANENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_LOSSBILLPLANENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_LOSSBILLENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_LOSSBILLENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_LOSSBILLENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_LOSSBILLENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_LOSSBILLENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_INVOICEENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_INVOICEENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_INVOICEENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_INVOICEENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_INVOICEENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_INVOICEENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_INVOICEENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_INVOICEENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLENTRY' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_AR_FINARBILLENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLENTRY' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_AR_FINARBILLENTRY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLENTRY' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_AR_FINARBILLENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLENTRY' AND KSQL_COL_NAME ='FMODIFYTIME') 
 ALTER TABLE T_AR_FINARBILLENTRY ADD (FMODIFYTIME DATETIME );

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