IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_programtype2]') AND type = 'U')
CREATE TABLE [dbo].[mps_programtype2]
(
    [pt2_ptid] int NOT NULL DEFAULT((0)),
    [pt2_tag] int NOT NULL DEFAULT((0)),
    [pt2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [pt2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt2_page] int NULL DEFAULT((1)),
    CONSTRAINT [PK_MPS_PROGRAMTYPE2] PRIMARY KEY ([pt2_ptid] ASC,[pt2_tag] ASC,[pt2_group] ASC)
)

ALTER TABLE [dbo].[mps_programtype2] WITH CHECK ADD CONSTRAINT [FK_MPS_PROG_REFERENCE_MPS_PROG] FOREIGN KEY ([pt2_ptid]) REFERENCES [dbo].[mps_programtype] ([pt_id]) ON DELETE CASCADEALTER TABLE [dbo].[mps_programtype2] CHECK CONSTRAINT [FK_MPS_PROG_REFERENCE_MPS_PROG]