/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
 EXEC p_AlterColumn 'T_BDM_INV_SPLIT_RULE', 'FRULECODE', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FUSEORG') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FUSEORG BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FCTRLSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FMASTERID') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_SPLIT_RULE' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_BDM_INV_SPLIT_RULE ADD (FENABLE VARCHAR(30) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_INV_SPLIT_RULE_L') 
 CREATE TABLE T_BDM_INV_SPLIT_RULE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FRULENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);



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