/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DIMSHAREMEMBER') 
CREATE TABLE T_EB_DIMSHAREMEMBER (
FID                  BIGINT               NOT NULL DEFAULT 0,
FNAME                NVARCHAR(50)         NOT NULL DEFAULT ' ',
FNUMBER              NVARCHAR(50)         NOT NULL DEFAULT ' ',
FLONGNUMBER          NCLOB                ,
FPARENTID            BIGINT        		  NOT NULL DEFAULT '0',
FSTORAGETYPE         CHAR(1)              NOT NULL DEFAULT '3',
FSEQ                 INT                  NOT NULL DEFAULT 1,
FLEVEL               INT                  NOT NULL DEFAULT 1,
FISLEAF              CHAR(1)              NOT NULL DEFAULT '1',
FDIMENSIONID         BIGINT               NOT NULL DEFAULT 0,
FMODELID             BIGINT               NOT NULL DEFAULT 0,
FMEMBERSOURCE        CHAR(1)              NOT NULL DEFAULT '0',
FENABLE              VARCHAR(5)           NOT NULL DEFAULT '1',
FSTATUS              VARCHAR(5)           NOT NULL DEFAULT 'C',
FMEMBERID            BIGINT               NOT NULL DEFAULT 0,
FMODIFIERID          BIGINT               NOT NULL DEFAULT 0,
FCREATORID           BIGINT               NOT NULL DEFAULT 0,
FMODIFYTIME          DATETIME             ,
FCREATETIME          DATETIME            
);

 EXEC P_ALTERPK 'PK_T_EB_DIMSHAREMEMBER', 'T_EB_DIMSHAREMEMBER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DIMSHAREMEMBER_P1')
CREATE INDEX IDX_EB_DIMSHAREMEMBER_P1 ON T_EB_DIMSHAREMEMBER (
FMODELID ASC,
FNUMBER ASC
);



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