IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_privategroup2]') AND type = 'U')
CREATE TABLE [dbo].[mps_privategroup2]
(
    [pgd_id] int NOT NULL IDENTITY(1, 1),
    [pgd_pgid] int NULL DEFAULT((0)),
    [pgd_caption] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pgd_flag] int NULL DEFAULT((0)),
    [pgd_objid] int NULL DEFAULT((0)),
    [pgd_objid2] int NULL DEFAULT((0)),
    [pgd_sql] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_PRIVATEGROUP2] PRIMARY KEY ([pgd_id] ASC)
)

ALTER TABLE [dbo].[mps_privategroup2] WITH CHECK ADD CONSTRAINT [FK_MPS_PRIV_REFERENCE_MPS_PRIV] FOREIGN KEY ([pgd_pgid]) REFERENCES [dbo].[mps_privategroup] ([pg_id]) ON DELETE CASCADEALTER TABLE [dbo].[mps_privategroup2] CHECK CONSTRAINT [FK_MPS_PRIV_REFERENCE_MPS_PRIV]