/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_MATCH_ORI_INV_SET' AND KSQL_COL_NAME ='FITEMMATCHKEY')
 ALTER TABLE T_BDM_MATCH_ORI_INV_SET ADD (FITEMMATCHKEY NVARCHAR(300) DEFAULT 'goodsname,goodscode' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_MATCH_ORI_INV_SET' AND KSQL_COL_NAME ='FITEMMATCHFIELD')
 ALTER TABLE T_BDM_MATCH_ORI_INV_SET ADD (FITEMMATCHFIELD NVARCHAR(600) DEFAULT '商品名称_税收分类合并编码' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_MATCH_ORI_INV_SET' AND KSQL_COL_NAME ='FINVOICEMATCHFIELD')
 ALTER TABLE T_BDM_MATCH_ORI_INV_SET ADD (FINVOICEMATCHFIELD NVARCHAR(600) DEFAULT '发票种类' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_MATCH_ORI_INV_SET' AND KSQL_COL_NAME ='FINVOICEMATCHKEY') 
 ALTER TABLE T_BDM_MATCH_ORI_INV_SET ADD (FINVOICEMATCHKEY NVARCHAR(300) DEFAULT 'invoicetype' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_MATCH_ORI_INV_SET' AND KSQL_COL_NAME ='FMATCHSTANDARD') 
 ALTER TABLE T_BDM_MATCH_ORI_INV_SET ADD (FMATCHSTANDARD VARCHAR(30) DEFAULT '1' NOT NULL );

/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
