/**Begin D:\PDM_UPGRADE\pdm1\PLAN_DIMENSION_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_PLAN_DIMENSION') 
 CREATE TABLE T_MSPLAN_PLAN_DIMENSION (
FID                  BIGINT               NOT NULL DEFAULT 0, 
FNUMBER              NVARCHAR(255)         NOT NULL DEFAULT ' ',
FSTATUS              NVARCHAR(30)         NOT NULL DEFAULT ' ',
FCREATORID           BIGINT               NOT NULL DEFAULT 0,
FMODIFIERID          BIGINT               NOT NULL DEFAULT 0,
FENABLE              NVARCHAR(30)         NOT NULL DEFAULT ' ',
FCREATETIME          DATETIME             NULL,
FMODIFYTIME          DATETIME             NULL,
FMASTERID            BIGINT               NOT NULL DEFAULT 0,
FAUDITOR			 BIGINT				  NOT NULL DEFAULT 0,
FAUDITORTIME     	 DATETIME			  NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_PLAN_DIMENTRY') 
CREATE TABLE T_MSPLAN_PLAN_DIMENTRY (
FID                  BIGINT               NOT NULL DEFAULT 0,
FENTRYID             BIGINT               NOT NULL DEFAULT 0,
FSEQ                 INT                  NOT NULL DEFAULT 0,
FDIMENSIONNAME		 NVARCHAR(255)		  NOT NULL DEFAULT ' ',
FDIMENSIONTYPE		 NVARCHAR(30)		  NOT NULL DEFAULT ' ',
FASSOCIATIONOBJECT   NVARCHAR(50)		  NOT NULL DEFAULT ' '
);


/**End D:\PDM_UPGRADE\pdm1\PLAN_DIMENSION_table.sql **/
