IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_equctg2]') AND type = 'U')
CREATE TABLE [dbo].[mps_equctg2]
(
    [ec2_ecid] int NOT NULL DEFAULT((0)),
    [ec2_tag] int NOT NULL DEFAULT((0)),
    [ec2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ec2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ec2_page] int NULL DEFAULT((1)),
    CONSTRAINT [PK_MPS_EQUCTG2] PRIMARY KEY ([ec2_ecid] ASC,[ec2_tag] ASC,[ec2_group] ASC)
)

ALTER TABLE [dbo].[mps_equctg2] WITH CHECK ADD CONSTRAINT [FK_MPS_EQUC_REFERENCE_MPS_EQUC] FOREIGN KEY ([ec2_ecid]) REFERENCES [dbo].[mps_equctg] ([ec_id]) ON DELETE CASCADEALTER TABLE [dbo].[mps_equctg2] CHECK CONSTRAINT [FK_MPS_EQUC_REFERENCE_MPS_EQUC]