/**Begin D:\d_desk\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_INVOICE_PERMISSION' AND KSQL_COL_NAME ='FORGID') 
 ALTER TABLE T_BDM_INVOICE_PERMISSION ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='FORG') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (FORG BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='FEPINFO') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (FEPINFO BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='FEQUIPMENTNAME') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (FEQUIPMENTNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='F_DEVICE_IS_AUTHORIZE') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (F_DEVICE_IS_AUTHORIZE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='FTOTALSURPLUS') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (FTOTALSURPLUS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_TAX_EQUIPMENT' AND KSQL_COL_NAME ='FTOTALINVOICECOUNT') 
 ALTER TABLE T_BDM_TAX_EQUIPMENT ADD (FTOTALINVOICECOUNT BIGINT DEFAULT 0 NOT NULL );

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