/**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_productinbillentry_R' AND KSQL_COL_NAME ='freturnbaseqty') 
 ALTER TABLE t_im_productinbillentry_R ADD (freturnbaseqty BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='fremainreturnbaseqty') 
 ALTER TABLE t_im_productinbillentry_R ADD (fremainreturnbaseqty BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='freturnqty') 
 ALTER TABLE t_im_productinbillentry_R ADD (freturnqty BIGINT DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='fremainreturnqty') 
 ALTER TABLE t_im_productinbillentry_R ADD (fremainreturnqty BIGINT DEFAULT 0 NOT NULL );

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry', 'FRETURNSBASEQTY', 'NULL', 'NULL', '1001', 'NULL';
 
  --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry', 'FRETURNSQTY', 'NULL', 'NULL', '1001', 'NULL';
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
