/**智能单据体记录表 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_INTEL_AGENT_RECORD')
CREATE TABLE T_ER_INTEL_AGENT_RECORD (
                                         FID BIGINT DEFAULT 0 NOT NULL,
                                         FBILLTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
                                         FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
                                         FBILLID BIGINT DEFAULT 0 NOT NULL,
                                         FSESSIONID VARCHAR(255) DEFAULT ' ' NOT NULL,
                                         FCREATETIME DATETIME
);

EXEC p_AlterPK 'PK_ER_INTEL_AGENT_RECORD', 'T_ER_INTEL_AGENT_RECORD', 'FID', '0';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_INTEL_AGENT_RECORD' AND KSQL_INDNAME = 'IDX_ER_INTEL_AGENT_RECORD')
CREATE INDEX IDX_ER_INTEL_AGENT_RECORD ON T_ER_INTEL_AGENT_RECORD (FBILLID);







