IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_job_task]') AND type = 'U')
CREATE TABLE [dbo].[mps_job_task]
(
    [wt_id] int NOT NULL IDENTITY(1, 1),
    [wt_type] varchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [wt_wrkid] int NULL DEFAULT((0)),
    [wt_cmpid] int NULL DEFAULT((0)),
    [wt_bizid] int NULL DEFAULT((0)),
    [wt_ordid] bigint NULL DEFAULT((0)),
    [wt_useruid] int NULL DEFAULT((0)),
    [wt_task] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [wt_jbid] bigint NULL DEFAULT((0)),
    [wt_begin] datetime NULL DEFAULT(getdate()),
    [wt_interval] int NULL DEFAULT((0)),
    [wt_mbid] int NULL DEFAULT((0)),
    [wt_flag] int NULL DEFAULT((0)),
    [wt_identkey] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_JOB_TASK] PRIMARY KEY ([wt_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_job_task]') AND name = 'mps_job_task_index')
CREATE NONCLUSTERED INDEX [mps_job_task_index] ON [dbo].[mps_job_task]([wt_jbid] ASC)