/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJBIZTYPECFG') 
 CREATE TABLE T_BCM_ADJBIZTYPECFG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(10) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJBIZTYPECFG_L') 
 CREATE TABLE T_BCM_ADJBIZTYPECFG_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJBIZTYPECFGENTRY') 
 CREATE TABLE T_BCM_ADJBIZTYPECFGENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FISSHOW CHAR(1) DEFAULT '1' NOT NULL,
FBUSINESSTYPEVALUE NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJBIZTYPECFGENTRY_L') 
 CREATE TABLE T_BCM_ADJBIZTYPECFGENTRY_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPRESETNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSHOWNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FENTRYDESCRIPTION NVARCHAR(200) DEFAULT ' ' NOT NULL
);


 EXEC p_AlterColumn 'T_BCM_REPORTLIST', 'FGROUPID', 'NVARCHAR(200)', 'NOT NULL', '0100', ''' ''';


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