IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_ext_resource]') AND type = 'U')
CREATE TABLE [dbo].[mps_ext_resource]
(
    [etc_id] int NOT NULL IDENTITY(1, 1),
    [etc_cmpid] int NULL DEFAULT((0)),
    [etc_tag] int NULL DEFAULT((0)),
    [etc_caption] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_type] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_father] int NULL DEFAULT((0)),
    [etc_full] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_keys] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_code] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_level] int NULL DEFAULT((0)),
    [etc_order] int NULL DEFAULT((999)),
    [etc_share] int NULL DEFAULT((1)),
    [etc_querytime] int NULL DEFAULT((0)),
    [etc_groupfields] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc_status] int NULL DEFAULT((1)),
    [etc_security] int NULL DEFAULT((0)),
    [etc_changed] int NULL,
    CONSTRAINT [PK_MPS_EXT_RESOURCE] PRIMARY KEY ([etc_id] ASC)
)