IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_csttype2]') AND type = 'U')
CREATE TABLE [dbo].[mps_csttype2]
(
    [cst2_cstid] int NOT NULL DEFAULT((0)),
    [cst2_tag] int NOT NULL DEFAULT((0)),
    [cst2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cst2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cst2_page] int NULL DEFAULT((1)),
    [ct2_ctid] int NULL,
    [ct2_tag] int NULL,
    [ct2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
    [ct2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
    [ct2_page] int NULL,
)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_csttype2]') AND name = 'AK_MPS_CSTTYPE2_KEY_MPS_CSTT')
CREATE UNIQUE NONCLUSTERED INDEX [AK_MPS_CSTTYPE2_KEY_MPS_CSTT] ON [dbo].[mps_csttype2]([cst2_cstid] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_csttype2]') AND name = 'AK_MPS_CSTTYPE2_KEY_MPS_CSTT')
CREATE UNIQUE NONCLUSTERED INDEX [AK_MPS_CSTTYPE2_KEY_MPS_CSTT] ON [dbo].[mps_csttype2]([cst2_tag] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_csttype2]') AND name = 'AK_MPS_CSTTYPE2_KEY_MPS_CSTT')
CREATE UNIQUE NONCLUSTERED INDEX [AK_MPS_CSTTYPE2_KEY_MPS_CSTT] ON [dbo].[mps_csttype2]([cst2_group] ASC)