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 NULL DEFAULT((0)),
    [cc_addr] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_bcid] int NULL DEFAULT((0)),
    [cc_birth] datetime NULL DEFAULT('1900-1-1'),
    [cc_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_caption] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_cmpid] int NULL DEFAULT((0)),
    [cc_code] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_company] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_contact] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_createcuid] int NULL DEFAULT((0)),
    [cc_createdepart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_createdpid] int NULL DEFAULT((0)),
    [cc_createtime] datetime NULL DEFAULT(getdate()),
    [cc_creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_creditquantum] int NULL DEFAULT((0)),
    [cc_ctid] int NULL DEFAULT((0)),
    [cc_cuid] int NULL DEFAULT((0)),
    [cc_cuname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_depart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_dj] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_dpid] int NULL DEFAULT((0)),
    [cc_email] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_fccid] int NULL DEFAULT((0)),
    [cc_gender] int NULL DEFAULT((0)),
    [cc_gn] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_icon] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_id] bigint NOT NULL IDENTITY(1, 1),
    [cc_identno] varchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_identtype] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_mobile] varchar(18) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_monthday] varchar(4) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_msnqq] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_name] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_pp] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_rjph] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_score] decimal(18, 4) NULL DEFAULT((0)),
    [cc_security] int NULL DEFAULT((0)),
    [cc_sjch] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_source] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_status] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_tag] int NULL DEFAULT((0)),
    [cc_total] decimal(18, 4) NULL DEFAULT((0)),
    [cc_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_updated] datetime NULL DEFAULT(getdate()),
    [cc_use] int NULL DEFAULT((0)),
    [cc_useruid] bigint NULL DEFAULT((0)),
    [cc_value] decimal(18, 4) NULL DEFAULT((0)),
    [cc_wxqq] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_xg] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_xh] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_xq] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cc_zy] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    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)

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_ctid] ASC)

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

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