IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_MQLOG')
 CREATE TABLE T_ER_MQLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FMESSAGECONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMESSAGECONTENT_TAG NCLOB DEFAULT ' ',
FCREATETIME DATETIME
);

EXEC P_ALTERPK 'PK_ER_MQLOG', 'T_ER_MQLOG', 'FID ', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_MQLOG' AND KSQL_INDNAME = 'IDX_ER_MQLOG_CREATETIME') CREATE INDEX IDX_ER_MQLOG_CREATETIME ON T_ER_MQLOG ( FCREATETIME );