IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_account_type]') AND type = 'U')
CREATE TABLE [dbo].[mps_account_type]
(
    [at_id] int NOT NULL IDENTITY(1, 1),
    [at_cmpid] int NULL DEFAULT((0)),
    [at_type] char(4) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [at_note] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [at_scope] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_ACCOUNT_TYPE] PRIMARY KEY ([at_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_account_type]') AND name = 'mps_account_type_index')
CREATE NONCLUSTERED INDEX [mps_account_type_index] ON [dbo].[mps_account_type]([at_cmpid] ASC)