/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME IN ('FDIFFERENCE2')) 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FDIFFERENCE2 DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INTERGRATION' AND KSQL_COL_NAME IN ('FMYCOMPANYID')) 
 ALTER TABLE T_BCM_INTERGRATION ADD (FMYCOMPANYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INTERGRATION' AND KSQL_COL_NAME IN ('FDATASORTID')) 
 ALTER TABLE T_BCM_INTERGRATION ADD (FDATASORTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STRUCTOFDEFINED' AND KSQL_COL_NAME IN ('FISSEQ')) 
 ALTER TABLE T_BCM_STRUCTOFDEFINED ADD (FISSEQ CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_CONFIGSETTING') 
 CREATE TABLE T_BCM_CONFIGSETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONFIG NVARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTIOIN NVARCHAR(200) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FORMID VARCHAR(50) DEFAULT ' ' NOT NULL
);



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