IF
NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_MULIMP_RESULT')
CREATE TABLE T_BAS_MULIMP_RESULT
(
    FID           BIGINT       DEFAULT 0         NOT NULL,
    FNUMBER       VARCHAR(30)  DEFAULT ' '       NOT NULL,
    FSTATUS       CHAR(1)      DEFAULT 'C'       NOT NULL,
    FCREATORID    BIGINT       DEFAULT 0         NOT NULL,
    FMODIFIERID   BIGINT       DEFAULT 0         NOT NULL,
    FMODIFYTIME   DATETIME     DEFAULT GETDATE() NOT NULL,
    FCREATETIME   DATETIME,
    FOBJNAME      NVARCHAR(1000) DEFAULT ' ' NOT NULL,
    FTOTAL        INT          DEFAULT 0         NOT NULL,
    FFAILED       INT          DEFAULT 0         NOT NULL,
    FIMPORTSTATUS CHAR(1)      DEFAULT ' '       NOT NULL,
    FUSETIME      INT          DEFAULT 0         NOT NULL,
    FISDELETED    CHAR(1)      DEFAULT ' '       NOT NULL,
    FURL          VARCHAR(500) DEFAULT ' '       NOT NULL
);

EXEC P_ALTERPK 'PK_T_BAS_MULIMP_RESULT', 'T_BAS_MULIMP_RESULT', 'FID', '1';

IF
NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MULTI_IMP_RESULT_NUMBER') CREATE
UNIQUE INDEX IDX_MULTI_IMP_RESULT_NUMBER ON T_BAS_MULIMP_RESULT ( FNUMBER );
