IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_customer2]') AND type = 'U')
CREATE TABLE [dbo].[mps_customer2]
(
    [cc_accountperiod] int NOT NULL DEFAULT((0)),
    [cc_activetime] datetime NOT NULL DEFAULT(getdate()),
    [cc_addr] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_bcid] int NOT NULL DEFAULT((0)),
    [cc_birth] datetime NOT NULL DEFAULT('1900-1-1'),
    [cc_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_caption] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_cmpid] int NOT NULL DEFAULT((0)),
    [cc_code] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_company] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_contact] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_createcuid] int NOT NULL DEFAULT((0)),
    [cc_createdepart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT('0'),
    [cc_createdpid] int NOT NULL DEFAULT((0)),
    [cc_createtime] datetime NOT NULL DEFAULT(getdate()),
    [cc_creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_creditquantum] int NOT NULL DEFAULT((0)),
    [cc_ctid] int NOT NULL DEFAULT((0)),
    [cc_cuid] int NOT NULL DEFAULT((0)),
    [cc_cuname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_depart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_dpid] int NOT NULL DEFAULT((0)),
    [cc_email] varchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_fccid] int NOT NULL DEFAULT((0)),
    [cc_gender] int NOT NULL DEFAULT((0)),
    [cc_icon] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_id] bigint NOT NULL IDENTITY(1, 1),
    [cc_identno] varchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_identtype] nvarchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_mobile] varchar(18) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_monthday] varchar(4) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_msnqq] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_name] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_score] decimal(18, 4) NOT NULL DEFAULT((0)),
    [cc_security] int NOT NULL DEFAULT((0)),
    [cc_source] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_status] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_tag] int NOT NULL DEFAULT((0)),
    [cc_total] decimal(18, 4) NOT NULL DEFAULT((0)),
    [cc_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cc_updated] datetime NOT NULL DEFAULT(getdate()),
    [cc_use] int NOT NULL DEFAULT((0)),
    [cc_value] decimal(18, 4) NOT NULL DEFAULT((0)),
    CONSTRAINT [mps_customer2_pk] PRIMARY KEY ([cc_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_customer2]') AND name = 'mps_customer2_index_1')
CREATE NONCLUSTERED INDEX [mps_customer2_index_1] ON [dbo].[mps_customer2]([cc_cmpid] ASC,[cc_ctid] ASC)