/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ACCOUNTRELATE') 
 CREATE TABLE T_EB_ACCOUNTRELATE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDIMID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCE CHAR(1) DEFAULT ' ' NOT NULL,
FDIM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBER NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFACCOUNT' AND KSQL_COL_NAME IN ('FISRELATED')) 
 ALTER TABLE T_EB_STRUCTOFACCOUNT ADD (FISRELATED CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFACCOUNT' AND KSQL_COL_NAME IN ('FRELATEDACCOUNT')) 
 ALTER TABLE T_EB_STRUCTOFACCOUNT ADD (FRELATEDACCOUNT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_STRUCTOFACCOUNT' AND KSQL_COL_NAME IN ('FDATASET')) 
 ALTER TABLE T_EB_STRUCTOFACCOUNT ADD (FDATASET BIGINT DEFAULT 0 NOT NULL );


/**End D:\PDM_UPGRADE\PDM1\EB_table.sql **/
