/**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_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTITY') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FSUBSRCBILLENTITY NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTRYID') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FSUBSRCBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLID') 
 ALTER TABLE T_IM_ASSEMBBILLSUBENTRY ADD (FSUBSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTITY') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FSUBSRCBILLENTITY NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTRYID') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FSUBSRCBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_DISASSEMBLESUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLID') 
 ALTER TABLE T_IM_DISASSEMBLESUBENTRY ADD (FSUBSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTITY') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FSUBSRCBILLENTITY NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLENTRYID') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FSUBSRCBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILLSUBENTRY' AND KSQL_COL_NAME ='FSUBSRCBILLID') 
 ALTER TABLE T_IM_ADJUSTBILLSUBENTRY ADD (FSUBSRCBILLID BIGINT DEFAULT 0 NOT NULL );

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