IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_alarm_message]') AND type = 'U')
CREATE TABLE [dbo].[mps_alarm_message]
(
    [almmsg_id] bigint NOT NULL IDENTITY(1, 1),
    [almmsg_type] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT('message'),
    [almmsg_cmpid] int NULL DEFAULT((0)),
    [almmsg_almid] int NULL DEFAULT((0)),
    [almmsg_text] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_date] datetime NULL DEFAULT(getdate()),
    [almmsg_cuid] int NULL DEFAULT((0)),
    [almmsg_identkey] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_category] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_read] int NULL DEFAULT((1)),
    [almmsg_lastdate] datetime NULL DEFAULT('1900-1-1'),
    [almmsg_sndcuid] int NULL DEFAULT((0)),
    [almmsg_sndname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_objtype] varchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [almmsg_ctgid] int NULL,
    [almmsg_ctgid2] int NULL DEFAULT((0)),
    [almmsg_objid] bigint NULL DEFAULT((0)),
    [almmsg_jbid] bigint NULL DEFAULT((0)),
    CONSTRAINT [PK_mps_alarm_message] PRIMARY KEY ([almmsg_id] ASC)
)