IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_command]') AND type = 'U')
CREATE TABLE [dbo].[mps_command]
(
    [cmd_sn] int NOT NULL IDENTITY(1, 1),
    [cmd_code] varchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cmd_time] datetime NULL DEFAULT(getdate()),
    [cmd_name] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cmd_status] int NULL DEFAULT((0)),
    [cmp_cmpid] int NULL DEFAULT((0)),
    [cmd_cmpid] int NULL DEFAULT((0)),
    CONSTRAINT [PK_MPS_COMMAND] PRIMARY KEY ([cmd_sn] ASC)
)

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