IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_ext_resource2]') AND type = 'U')
CREATE TABLE [dbo].[mps_ext_resource2]
(
    [etc2_etcid] int NOT NULL DEFAULT((0)),
    [etc2_tag] int NOT NULL DEFAULT((0)),
    [etc2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [etc2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [etc2_page] int NULL DEFAULT((1)),
    CONSTRAINT [PK_MPS_EXT_RESOURCE2] PRIMARY KEY ([etc2_etcid] ASC,[etc2_tag] ASC,[etc2_group] ASC)
)

ALTER TABLE [dbo].[mps_ext_resource2] WITH CHECK ADD CONSTRAINT [FK_MPS_EXT__REFERENCE_MPS_EXT_] FOREIGN KEY ([etc2_etcid]) REFERENCES [dbo].[mps_ext_resource] ([etc_id]) ON DELETE CASCADEALTER TABLE [dbo].[mps_ext_resource2] CHECK CONSTRAINT [FK_MPS_EXT__REFERENCE_MPS_EXT_]