/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INV_REALBALANCE' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_INV_REALBALANCE ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_CAL_PER_BAL' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_CAL_PER_BAL ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INV_PER_BAL' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_INV_PER_BAL ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_ADJUSTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_ADJUSTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_ADJUSTBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_ASSEMBBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_ASSEMBBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_ASSEMBBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLEENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_DISASSEMBLEENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLEENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_DISASSEMBLEENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLEENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_DISASSEMBLEENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_LOCATIONTRANSENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_LOCATIONTRANSENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_LOCATIONTRANSENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_LOCATIONTRANSENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FNOUPDATEINVFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FMFTORDERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FMFTORDERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FMFTORDERNUMBER') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FMFTORDERNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FMFTORDERENTRYID') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FMFTORDERENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FMFTORDERENTRYSEQ') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FMFTORDERENTRYSEQ BIGINT DEFAULT 0 NOT NULL );

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