/**Begin D:\PDM_UPGRADE\PDM1\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FGROUPSEQ') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FGROUPSEQ') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSMREQOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_OSMREQOUTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSMREQOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_OSMREQOUTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FGROUPSEQ') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSPURINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_OSPURINBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSPURINBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_OSPURINBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FGROUPSEQ') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FGROUPNUMBER') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FGROUPNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FGROUPSEQ') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FGROUPSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVINSPECTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_INVINSPECTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVINSPECTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_INVINSPECTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPNO') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FBIZCOOPNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FBIZCOOPENTRYID') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FBIZCOOPENTRYID BIGINT DEFAULT 0 NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\IM_table.sql **/
