/**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_LOCATIONTRANSENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_LOCATIONTRANSENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_MREQOUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSMREQOUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_OSMREQOUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSPURINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_OSPURINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
 ALTER TABLE T_IM_MREQBILLENTRY ADD (FSERIALNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );

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