
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FOFFERINGEDIT')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FOFFERINGEDIT NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FLEVEL1EDIT')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FLEVEL1EDIT NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FMDSUSER')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FMDSUSER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FSPDT')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FSPDT NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FEDITUSER')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FEDITUSER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FEDITDATE')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FEDITDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FEDITCREATEDATE')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FEDITCREATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FENTRYMODIFIER')
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FENTRYMODIFIER BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_VRDS' AND KSQL_COL_NAME ='FINPUTCONTROL') 
 ALTER TABLE T_MDS_VRDS ADD (FINPUTCONTROL NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DATEENTRY' AND KSQL_COL_NAME ='FID2') 
 ALTER TABLE T_MDS_DATEENTRY ADD (FID2 BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FID2') 
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FID2 BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FSEQ2') 
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FSEQ2 BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_FCDATATS_MULTI') 
 CREATE TABLE T_MDS_FCDATATS_MULTI (
FID2 BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLESTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FFCVRNNUM BIGINT DEFAULT 0 NOT NULL,
FINVALDATE            DATETIME
);



