/* 创建商品名称映射费用项目表 */
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_NAMERFLITEM') 
 CREATE TABLE T_ER_NAMERFLITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FGOODNAMES NVARCHAR(255) DEFAULT ' ' NOT NULL
);


/* 创建索引 */
EXEC P_ALTERPK 'PK_T_ER_NAMERFLITEM', 'T_ER_NAMERFLITEM', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_NAMERFLITEM_GN') CREATE INDEX IDX_NAMERFLITEM_GN ON T_ER_NAMERFLITEM ( FGOODNAMES );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FID') CREATE INDEX IDX_FID ON T_ER_NAMERFLITEM ( FID );