/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMOVETRACK' AND KSQL_COL_NAME ='FBIZTYPEID') 
 ALTER TABLE T_BD_SNMOVETRACK ADD (FBIZTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMOVETRACK' AND KSQL_COL_NAME ='FBIZDEPTID') 
 ALTER TABLE T_BD_SNMOVETRACK ADD (FBIZDEPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMOVETRACK' AND KSQL_COL_NAME ='FBILLSTATUS') 
 ALTER TABLE T_BD_SNMOVETRACK ADD (FBILLSTATUS CHAR(1) DEFAULT 'A' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FBILLID') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FINVORGID') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FINVORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FSBILLINVFLUCTUATION') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FSBILLINVFLUCTUATION CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FINCREASEINVCOUNTER') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FINCREASEINVCOUNTER INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FSUBSTRACTINVCOUNTER') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FSUBSTRACTINVCOUNTER INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FTRAINCREASEINVCOUNTER') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FTRAINCREASEINVCOUNTER INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FTRASUBSTRACTINVCOUNTER') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FTRASUBSTRACTINVCOUNTER INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_SNMAINFILE' AND KSQL_COL_NAME ='FISIMPORT') 
 ALTER TABLE T_BD_SNMAINFILE ADD (FISIMPORT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_MATERIALINVINFO' AND KSQL_COL_NAME ='FISOUTPUTREQUEST') 
 ALTER TABLE T_BD_MATERIALINVINFO ADD (FISOUTPUTREQUEST CHAR(1) DEFAULT '0' NOT NULL );

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