USE [CRM]
GO
/****** Object:  Table [dbo].[CiSequence]    Script Date: 05/03/2016 15:49:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CiSequence](
	[Id] [int] IDENTITY(13,1) NOT NULL,
	[FullName] [nvarchar](200) NOT NULL,
	[Prefix] [nvarchar](50) NULL,
	[Separate] [nvarchar](50) NULL,
	[Sequence] [int] NOT NULL,
	[Reduction] [int] NOT NULL,
	[Step] [int] NOT NULL,
	[CreateOn] [datetime] NOT NULL,
	[Description] [nvarchar](800) NULL
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[CiSequence] ON
INSERT [dbo].[CiSequence] ([Id], [FullName], [Prefix], [Separate], [Sequence], [Reduction], [Step], [CreateOn], [Description]) VALUES (15, N'Customer', N'', N'', 10000016, 9999999, 1, CAST(0x0000A0B00114BD97 AS DateTime), N'')
INSERT [dbo].[CiSequence] ([Id], [FullName], [Prefix], [Separate], [Sequence], [Reduction], [Step], [CreateOn], [Description]) VALUES (16, N'LinkMan', N'', N'', 10000015, 9999999, 1, CAST(0x0000A0B001180DD9 AS DateTime), N'')
INSERT [dbo].[CiSequence] ([Id], [FullName], [Prefix], [Separate], [Sequence], [Reduction], [Step], [CreateOn], [Description]) VALUES (17, N'IncomingCall', N'', N'', 10000002, 9999999, 1, CAST(0x0000A0C1010D3B88 AS DateTime), N'')
INSERT [dbo].[CiSequence] ([Id], [FullName], [Prefix], [Separate], [Sequence], [Reduction], [Step], [CreateOn], [Description]) VALUES (12, N'CiItemDetails', N'', N'', 10000045, 9999999, 1, CAST(0x0000A09300A5C72D AS DateTime), N'')
INSERT [dbo].[CiSequence] ([Id], [FullName], [Prefix], [Separate], [Sequence], [Reduction], [Step], [CreateOn], [Description]) VALUES (14, N'CustomerClass', N'', N'', 10000044, 9999999, 1, CAST(0x0000A0AF010EAEED AS DateTime), N'')
SET IDENTITY_INSERT [dbo].[CiSequence] OFF
/****** Object:  Table [dbo].[CustomerClass]    Script Date: 05/03/2016 15:49:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CustomerClass](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ParentId] [int] NULL,
	[ClassName] [nvarchar](50) NOT NULL,
	[ClassCode] [nvarchar](30) NULL,
	[Description] [nvarchar](800) NULL,
	[SortCode] [int] NULL,
	[DeleteMark] [int] NOT NULL,
	[CreateOn] [datetime] NOT NULL,
	[CreateUserId] [nvarchar](50) NULL,
	[CreateBy] [nvarchar](50) NULL,
	[ModifiedOn] [datetime] NULL,
	[ModifiedUserId] [nvarchar](50) NULL,
	[ModifiedBy] [nvarchar](50) NULL,
 CONSTRAINT [PK_CUSTOMERCLASS] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父节点ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ParentId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ClassCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'SortCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'CreateOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'CreateBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ModifiedOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ModifiedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass', @level2type=N'COLUMN',@level2name=N'ModifiedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CustomerClass'
GO
SET IDENTITY_INSERT [dbo].[CustomerClass] ON
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (1, NULL, N'所有客户', NULL, NULL, 10000000, 0, CAST(0x0000A0AF00A5410D AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (2, NULL, N'最近使用客户', NULL, NULL, 10000001, 0, CAST(0x0000A0AF00A563C5 AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (3, NULL, N'经常使用客户', NULL, NULL, 10000002, 0, CAST(0x0000A0AF00A584E0 AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (4, NULL, N'固定客户', NULL, NULL, 10000003, 0, CAST(0x0000A0AF00A5BFBE AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (5, NULL, N'所有分类', NULL, NULL, 10000004, 0, CAST(0x0000A0AF00A606CE AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (6, 5, N'地区', NULL, NULL, 10000005, 0, CAST(0x0000A0AF00A63A4C AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (7, 5, N'关系', NULL, NULL, 10000006, 0, CAST(0x0000A0AF00A64E4F AS DateTime), N'1', N'系统管理员', NULL, NULL, NULL)
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (10, 5, N'新分类', N'', N'', 10000009, 1, CAST(0x0000A0AF010FE456 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF010FE456 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (11, 5, N'新分类', N'', N'', 10000010, 1, CAST(0x0000A0AF01152269 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF01152269 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (12, 5, N'重要程度', N'', N'', 10000011, 0, CAST(0x0000A0AF01156EE9 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF01156EE9 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (13, 6, N'新分类', N'', N'', 10000012, 1, CAST(0x0000A0AF0116D5DA AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF0116D5DA AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (22, 7, N'客户类别', N'', N'', 10000021, 0, CAST(0x0000A0AF0117EA9D AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF0117EA9D AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (23, 7, N'客户来源', N'', N'', 10000022, 0, CAST(0x0000A0AF011AC20A AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011AC20A AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (24, 7, N'客户潜力', N'', N'', 10000023, 0, CAST(0x0000A0AF011ADFF0 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011ADFF0 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (25, 7, N'新分类', N'', N'', 10000024, 1, CAST(0x0000A0AF011B592D AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011B592D AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (26, 7, N'行业类别', N'', N'', 10000025, 0, CAST(0x0000A0AF011EAE30 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011EAE30 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (27, 12, N'新分类', N'', N'', 10000026, 1, CAST(0x0000A0AF011F1733 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F1733 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (28, 12, N'五级', N'', N'', 10000027, 0, CAST(0x0000A0AF011F1C17 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F1C17 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (29, 12, N'四级', N'', N'', 10000028, 0, CAST(0x0000A0AF011F236E AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F236E AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (30, 12, N'三级', N'', N'', 10000029, 0, CAST(0x0000A0AF011F2D57 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F2D57 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (31, 12, N'二级', N'', N'', 10000030, 0, CAST(0x0000A0AF011F328F AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F328F AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (32, 12, N'一级', N'', N'', 10000031, 0, CAST(0x0000A0AF011F3934 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F3934 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (34, 6, N'成都', N'', N'', 10000033, 0, CAST(0x0000A0AF011F4C65 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F4C65 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (35, 6, N'海南', N'', N'', 10000034, 0, CAST(0x0000A0AF011F5355 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F5355 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (36, 6, N'北京', N'', N'', 10000035, 0, CAST(0x0000A0AF011F5E72 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0AF011F5E72 AS DateTime), N'', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (38, NULL, N'新分类', N'', N'', 10000037, 0, CAST(0x0000A25B00AD25EB AS DateTime), N'3', N'超级管理员', CAST(0x0000A25B00AD25EB AS DateTime), N'3', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (40, NULL, N'新分类', NULL, NULL, 10000039, 0, CAST(0x0000A4D800EF3111 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员', CAST(0x0000A4D800EF3111 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (41, NULL, N'新分类', NULL, NULL, 10000040, 0, CAST(0x0000A4D800EF3568 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员', CAST(0x0000A4D800EF3568 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (42, 6, N'新分类', NULL, NULL, 10000041, 0, CAST(0x0000A4D800EF384D AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员', CAST(0x0000A4D800EF384D AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[CustomerClass] ([Id], [ParentId], [ClassName], [ClassCode], [Description], [SortCode], [DeleteMark], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (44, 5, N'新分类', NULL, NULL, 10000043, 0, CAST(0x0000A4D800EF43B5 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员', CAST(0x0000A4D800EF43B5 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
SET IDENTITY_INSERT [dbo].[CustomerClass] OFF
/****** Object:  Table [dbo].[Customer]    Script Date: 05/03/2016 15:49:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Code] [nvarchar](50) NOT NULL,
	[CustomerClassID] [int] NULL,
	[FullName] [nvarchar](200) NOT NULL,
	[ShortName] [nvarchar](100) NULL,
	[CompanyName] [nvarchar](200) NOT NULL,
	[Lelvel] [int] NULL,
	[Satisfy] [int] NOT NULL,
	[Credit] [int] NOT NULL,
	[CompanyAddress] [nvarchar](500) NULL,
	[PostalCode] [nvarchar](50) NULL,
	[CompanyPhone] [nvarchar](50) NULL,
	[CompanyFax] [nvarchar](50) NULL,
	[WebAddress] [nvarchar](200) NULL,
	[EstablishDate] [datetime] NULL,
	[LicenceNo] [nvarchar](50) NULL,
	[Chieftain] [nvarchar](50) NULL,
	[Bankroll] [bigint] NULL,
	[Turnover] [bigint] NULL,
	[Bank] [nvarchar](200) NULL,
	[BankAccount] [nvarchar](50) NULL,
	[LocalTaxNo] [nvarchar](50) NULL,
	[NationalTaxNo] [nvarchar](50) NULL,
	[Status] [int] NOT NULL,
	[Description] [nvarchar](800) NULL,
	[DeleteMark] [int] NOT NULL,
	[SortCode] [int] NULL,
	[CreateOn] [datetime] NOT NULL,
	[CreateUserId] [nvarchar](50) NULL,
	[CreateBy] [nvarchar](50) NULL,
	[ModifiedOn] [datetime] NULL,
	[ModifiedUserId] [nvarchar](50) NULL,
	[ModifiedBy] [nvarchar](50) NULL,
 CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Code'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户分类主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CustomerClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户全称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'FullName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户简称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'ShortName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CompanyName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户等级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Lelvel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'满意度（1至5），默认为3。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Satisfy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'信用度（1至5），默认为3。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Credit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CompanyAddress'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司邮编' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'PostalCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CompanyPhone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司传真' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CompanyFax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'WebAddress'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'成立日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'EstablishDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'营业执照注册号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'LicenceNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'法人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Chieftain'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'注册资金' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Bankroll'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'营业额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Turnover'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开户银行' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Bank'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行账号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'BankAccount'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地税登记号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'LocalTaxNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'国税登记号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'NationalTaxNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户状态：1-正常、2-流失、3-删除。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述、补充说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'SortCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CreateOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'CreateBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'ModifiedOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'ModifiedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'COLUMN',@level2name=N'ModifiedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Customer'
GO
SET IDENTITY_INSERT [dbo].[Customer] ON
INSERT [dbo].[Customer] ([Id], [Code], [CustomerClassID], [FullName], [ShortName], [CompanyName], [Lelvel], [Satisfy], [Credit], [CompanyAddress], [PostalCode], [CompanyPhone], [CompanyFax], [WebAddress], [EstablishDate], [LicenceNo], [Chieftain], [Bankroll], [Turnover], [Bank], [BankAccount], [LocalTaxNo], [NationalTaxNo], [Status], [Description], [DeleteMark], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (2, N'hskj', 35, N'华思科技有限公司', N'华思科技', N'华思科技', 0, 1, 5, N'四川成都', N'100000', N'028-55021240', N'028-55021240', N'http://www.hskj.com', CAST(0x00009E9A00000000 AS DateTime), N'', N'', 0, 0, N'', N'', N'', N'', 1, N'', 0, 0, CAST(0x0000A0AF00DDAF2D AS DateTime), NULL, NULL, CAST(0x0000A5BC010510E4 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[Customer] ([Id], [Code], [CustomerClassID], [FullName], [ShortName], [CompanyName], [Lelvel], [Satisfy], [Credit], [CompanyAddress], [PostalCode], [CompanyPhone], [CompanyFax], [WebAddress], [EstablishDate], [LicenceNo], [Chieftain], [Bankroll], [Turnover], [Bank], [BankAccount], [LocalTaxNo], [NationalTaxNo], [Status], [Description], [DeleteMark], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (12, N'da70397b-96c0-46c7-8c2e-c0586b464a4c', 34, N'北京创新乐知信息技术有限公司', N'CSDN', N'北京创新乐知信息技术有限公司', NULL, 2, 3, N'北京市朝阳区广顺北大街33号院1号楼福码大厦B座12层', N'100102', N'010-51661202-110', N'010-64348545', N'http://www.csdn.net/', CAST(0x0000A0A000000000 AS DateTime), N'', N'', 0, 0, N'', N'', N'', N'', 1, N'CSDN创立于1999年，是中国最大的中文IT知识服务集团，专注IT信息传播、技术交流、教育培训和专业技术人才服务。拥有超过1800万注册会员、10000名CTO、50万注册企业及合作伙伴，全球中文网站排名第27位。', 0, 10000013, CAST(0x0000A0B001213CE7 AS DateTime), N'3', N'超级管理员', CAST(0x0000A40A010306D3 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[Customer] ([Id], [Code], [CustomerClassID], [FullName], [ShortName], [CompanyName], [Lelvel], [Satisfy], [Credit], [CompanyAddress], [PostalCode], [CompanyPhone], [CompanyFax], [WebAddress], [EstablishDate], [LicenceNo], [Chieftain], [Bankroll], [Turnover], [Bank], [BankAccount], [LocalTaxNo], [NationalTaxNo], [Status], [Description], [DeleteMark], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (13, N'b50311d3-bcab-4f32-8ccc-637ec6ae7355', 44, N'北京无忧创想信息技术有限公司', N'51CTO传媒', N'北京无忧创想信息技术有限公司', 0, 2, 4, N'北京市海淀区西三环北路21号久凌大厦北楼5层', N'100089', N'(010)68476636/6606/9356/9336', N'', N'http://www.51cto.com/', CAST(0x00008EAC00000000 AS DateTime), N'', N'', 0, 0, N'', N'', N'', N'', 1, N'北京无忧创想信息技术有限公司（以下简称"51CTO传媒"）是专注于IT技术创新与发展的互联网媒体机构，由一批资深互联网专业人士创立于2005年。自建立之日起，51CTO传媒就以"专注IT技术领域，打造中国领先的IT技术网络平台"为宗旨，致力于面向中国广大IT专业人群，实现高效传播交流，持续提升技术及管理水准，促进中国信息化建设及应用健康快速发展。
51CTO传媒旗下现拥有定位各有侧重的五个网络平台，包括：51CTO.com、CIOAge.com、WatchStor.com、HC3i.cn和LinkPhone.cn；分别聚焦企业级IT技术及应用、行业信息化建设、数据存储安全、数字医疗及医疗信息化、移动时代智能生活等领域，拥有上千万专业会员，覆盖全国主流城市大多数IT从业人员；为数千万读者、数百家企业提供优质服务。今日的51CTO传媒已经发展成为中国IT领域具有领先地位的专业互联网媒体机构，其内容特色鲜明、影响广泛深入、读者数量庞大。
经过多年发展，51CTO传媒逐步建立了现代化的企业管理制度和良好的公司治理结构，企业提倡以"坚持、包容、团结、目标、价值"为特征的水文化价值观，形成了一支充满朝气、富有理想的年青团队，并以优质产品、优良服务赢得业内广泛赞誉。公司荣膺中关村科技园区国家高新技术企业、北京市重点扶持发展文化创意产业企业、共青团中央青年就业创业见习基地、CCTV/CNTV中国公开课IT类独家合作伙伴等诸多荣誉。
技术成就梦想，IT推动创新。51CTO传媒愿与您共同实现IT创新之梦！', 0, 10000014, CAST(0x0000A0B3009AD649 AS DateTime), N'3', N'超级管理员', CAST(0x0000A5D900EFCF95 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
SET IDENTITY_INSERT [dbo].[Customer] OFF
/****** Object:  Table [dbo].[LinkMan]    Script Date: 05/03/2016 15:49:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[LinkMan](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CustomerId] [int] NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Sex] [nvarchar](5) NULL,
	[Postion] [nvarchar](50) NULL,
	[Department] [nvarchar](50) NULL,
	[MainLinkMan] [int] NOT NULL,
	[MobilePhone] [nvarchar](50) NULL,
	[Telephone] [nvarchar](50) NULL,
	[ShortNumber] [varchar](50) NULL,
	[IDCard] [varchar](50) NULL,
	[OfficeAddress] [varchar](200) NULL,
	[OfficeFax] [varchar](50) NULL,
	[HomePhone] [varchar](50) NULL,
	[Education] [varchar](50) NULL,
	[School] [varchar](50) NULL,
	[Degree] [varchar](50) NULL,
	[HomeZipCode] [varchar](50) NULL,
	[HomeAddress] [varchar](200) NULL,
	[HomeFax] [varchar](50) NULL,
	[NativePlace] [varchar](50) NULL,
	[Party] [varchar](50) NULL,
	[Nation] [varchar](50) NULL,
	[Nationality] [varchar](50) NULL,
	[Major] [nvarchar](50) NULL,
	[EducationalBackground] [nvarchar](50) NULL,
	[BirthdayType] [int] NULL,
	[Birthday] [datetime] NULL,
	[BloodType] [nvarchar](10) NULL,
	[QQ] [nvarchar](50) NULL,
	[Email] [nvarchar](50) NULL,
	[Interest] [nvarchar](200) NULL,
	[Description] [nvarchar](800) NULL,
	[DeleteMark] [int] NOT NULL,
	[Enabled] [int] NOT NULL,
	[SortCode] [int] NULL,
	[CreateOn] [datetime] NOT NULL,
	[CreateUserId] [nvarchar](50) NULL,
	[CreateBy] [nvarchar](50) NULL,
	[ModifiedOn] [datetime] NULL,
	[ModifiedUserId] [nvarchar](50) NULL,
	[ModifiedBy] [nvarchar](50) NULL,
 CONSTRAINT [PK_LINKMAN] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'CustomerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系人名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'职位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Postion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Department'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是主联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'MainLinkMan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'MobilePhone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Telephone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'短号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'ShortNumber'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'身份证号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'IDCard'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'办公地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'OfficeAddress'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'办公传真' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'OfficeFax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'住宅电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'HomePhone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最高学历' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Education'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'毕业院校' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'School'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最高学位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Degree'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'家庭住址邮编' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'HomeZipCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'家庭住址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'HomeAddress'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'家庭传真' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'HomeFax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'籍贯' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'NativePlace'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'政治面貌' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Party'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'国籍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Nation'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'民族' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Nationality'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专业' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Major'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'教育背景、学历' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'EducationalBackground'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生日类型（公历生日取值为1、农历生日取值为2），默认为1。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'BirthdayType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生日' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Birthday'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'血型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'BloodType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QQ号码，多个用英语逗号隔开。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'QQ'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电子邮箱，多个用英语逗号隔开。' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'兴趣' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Interest'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述、备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'有效标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'Enabled'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'SortCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'CreateOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'CreateBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'ModifiedOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'ModifiedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan', @level2type=N'COLUMN',@level2name=N'ModifiedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LinkMan'
GO
SET IDENTITY_INSERT [dbo].[LinkMan] ON
INSERT [dbo].[LinkMan] ([Id], [CustomerId], [Name], [Sex], [Postion], [Department], [MainLinkMan], [MobilePhone], [Telephone], [ShortNumber], [IDCard], [OfficeAddress], [OfficeFax], [HomePhone], [Education], [School], [Degree], [HomeZipCode], [HomeAddress], [HomeFax], [NativePlace], [Party], [Nation], [Nationality], [Major], [EducationalBackground], [BirthdayType], [Birthday], [BloodType], [QQ], [Email], [Interest], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (10, 12, N'站长', N'男', N'', N'网站运维部', 1, N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', 1, NULL, N'', N'', N'webmaster@csdn.net', N'', N'', 0, 1, 10000009, CAST(0x0000A0B001213D16 AS DateTime), N'3', N'超级管理员', CAST(0x0000A5BC0105ACD3 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[LinkMan] ([Id], [CustomerId], [Name], [Sex], [Postion], [Department], [MainLinkMan], [MobilePhone], [Telephone], [ShortNumber], [IDCard], [OfficeAddress], [OfficeFax], [HomePhone], [Education], [School], [Degree], [HomeZipCode], [HomeAddress], [HomeFax], [NativePlace], [Party], [Nation], [Nationality], [Major], [EducationalBackground], [BirthdayType], [Birthday], [BloodType], [QQ], [Email], [Interest], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (11, 13, N'陈广一', N'女', N'工程师', N'广告部', 1, N'15108937790', N'028-52140001', N'', N'', N'', N'', N'', N'', N'', N'硕士', N'', N'', N'', N'', N'中共党员', N'', N'', N'', N'本科', 2, CAST(0x0000A0B500000000 AS DateTime), N'其他', N'406590790', N'wangqw@51cto.com', N'', N'', 0, 1, 10000010, CAST(0x0000A0B3009AD652 AS DateTime), N'3', N'超级管理员', CAST(0x0000A5D900EFCF9E AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[LinkMan] ([Id], [CustomerId], [Name], [Sex], [Postion], [Department], [MainLinkMan], [MobilePhone], [Telephone], [ShortNumber], [IDCard], [OfficeAddress], [OfficeFax], [HomePhone], [Education], [School], [Degree], [HomeZipCode], [HomeAddress], [HomeFax], [NativePlace], [Party], [Nation], [Nationality], [Major], [EducationalBackground], [BirthdayType], [Birthday], [BloodType], [QQ], [Email], [Interest], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (13, 2, N'胡志华', N'男', N'', N'技术开发部', 1, N'15108937790', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', 1, CAST(0x0000A5C400000000 AS DateTime), N'', N'406590790', N'406590790@qq.com', N'羽毛球、游泳、跑步、上网、交友', N'', 0, 1, 10000012, CAST(0x0000A0B300DBEE1C AS DateTime), N'3', N'超级管理员', CAST(0x0000A5BC010510ED AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[LinkMan] ([Id], [CustomerId], [Name], [Sex], [Postion], [Department], [MainLinkMan], [MobilePhone], [Telephone], [ShortNumber], [IDCard], [OfficeAddress], [OfficeFax], [HomePhone], [Education], [School], [Degree], [HomeZipCode], [HomeAddress], [HomeFax], [NativePlace], [Party], [Nation], [Nationality], [Major], [EducationalBackground], [BirthdayType], [Birthday], [BloodType], [QQ], [Email], [Interest], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (14, 13, N'测试数据', N'男', N'技术员', N'开发部', 1, N'151141711', N'0284554544', N'', N'', N'四川成都', N'0284554544', N'', N'', N'电子科大', N'硕士', N'', N'', N'', N'四川.成都', N'共青团员', N'中国', N'汉族', N'软件开发', N'硕士', 1, CAST(0x0000A0B400000000 AS DateTime), N'其他', N'123456789', N'123456789@qq.com', N'打球、游泳', N'', 0, 1, 10000013, CAST(0x0000A0B401228928 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0B500A03713 AS DateTime), N'3', N'超级管理员')
INSERT [dbo].[LinkMan] ([Id], [CustomerId], [Name], [Sex], [Postion], [Department], [MainLinkMan], [MobilePhone], [Telephone], [ShortNumber], [IDCard], [OfficeAddress], [OfficeFax], [HomePhone], [Education], [School], [Degree], [HomeZipCode], [HomeAddress], [HomeFax], [NativePlace], [Party], [Nation], [Nationality], [Major], [EducationalBackground], [BirthdayType], [Birthday], [BloodType], [QQ], [Email], [Interest], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (15, 13, N'测试仪', N'女', N'工程师', N'测试部', 0, N'1455252', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'中国', N'汉族', N'', N'', 1, NULL, N'', N'', N'', N'', N'', 1, 1, 10000014, CAST(0x0000A0B500A0ADE4 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0B500A0ADE4 AS DateTime), N'3', N'超级管理员')
SET IDENTITY_INSERT [dbo].[LinkMan] OFF
/****** Object:  Table [dbo].[IncomingCall]    Script Date: 05/03/2016 15:49:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IncomingCall](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CustomerId] [int] NULL,
	[CustomerName] [nvarchar](200) NOT NULL,
	[CallType] [nvarchar](50) NOT NULL,
	[CallRecord] [nvarchar](2000) NULL,
	[CallNumber] [nvarchar](50) NULL,
	[CallDate] [datetime] NULL,
	[Handled] [int] NOT NULL,
	[Description] [nvarchar](800) NULL,
	[DeleteMark] [int] NOT NULL,
	[Enabled] [int] NOT NULL,
	[SortCode] [int] NULL,
	[CreateOn] [datetime] NOT NULL,
	[CreateUserId] [nvarchar](50) NULL,
	[CreateBy] [nvarchar](50) NULL,
	[ModifiedOn] [datetime] NULL,
	[ModifiedUserId] [nvarchar](50) NULL,
	[ModifiedBy] [nvarchar](50) NULL,
 CONSTRAINT [PK_INCOMINGCALL] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述、备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'有效标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'Enabled'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'SortCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'CreateOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'CreateBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'ModifiedOn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'ModifiedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IncomingCall', @level2type=N'COLUMN',@level2name=N'ModifiedBy'
GO
SET IDENTITY_INSERT [dbo].[IncomingCall] ON
INSERT [dbo].[IncomingCall] ([Id], [CustomerId], [CustomerName], [CallType], [CallRecord], [CallNumber], [CallDate], [Handled], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (1, 13, N'51CTO传媒', N'合作', N'测试记录', N'15108937790', CAST(0x0000A0C100000000 AS DateTime), 1, N'', 0, 1, 10000000, CAST(0x0000A0C1010D3BA0 AS DateTime), N'3', N'超级管理员', CAST(0x0000A5D900EFEAE7 AS DateTime), N'26F43BC9-AE6D-42D2-BAC9-F4237A949484', N'超级管理员')
INSERT [dbo].[IncomingCall] ([Id], [CustomerId], [CustomerName], [CallType], [CallRecord], [CallNumber], [CallDate], [Handled], [Description], [DeleteMark], [Enabled], [SortCode], [CreateOn], [CreateUserId], [CreateBy], [ModifiedOn], [ModifiedUserId], [ModifiedBy]) VALUES (2, 13, N'51CTO传媒', N'销售机会', N'xcvcxz', N'xcvz', NULL, 0, N'', 0, 1, 10000001, CAST(0x0000A0C1010F1378 AS DateTime), N'3', N'超级管理员', CAST(0x0000A0C1010F1378 AS DateTime), N'3', N'超级管理员')
SET IDENTITY_INSERT [dbo].[IncomingCall] OFF
/****** Object:  Default [DF__CustomerC__Delet__48CFD27E]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[CustomerClass] ADD  DEFAULT ((0)) FOR [DeleteMark]
GO
/****** Object:  Default [DF__CustomerC__Creat__49C3F6B7]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[CustomerClass] ADD  DEFAULT (getdate()) FOR [CreateOn]
GO
/****** Object:  Default [DF__Customer__Satisf__4222D4EF]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF__Customer__Satisf__4222D4EF]  DEFAULT ((3)) FOR [Satisfy]
GO
/****** Object:  Default [DF__Customer__Credit__4316F928]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF__Customer__Credit__4316F928]  DEFAULT ((3)) FOR [Credit]
GO
/****** Object:  Default [DF__Customer__Status__440B1D61]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF__Customer__Status__440B1D61]  DEFAULT ((1)) FOR [Status]
GO
/****** Object:  Default [DF__Customer__Delete__44FF419A]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF__Customer__Delete__44FF419A]  DEFAULT ((0)) FOR [DeleteMark]
GO
/****** Object:  Default [DF__Customer__Create__45F365D3]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF__Customer__Create__45F365D3]  DEFAULT (getdate()) FOR [CreateOn]
GO
/****** Object:  Default [DF__LinkMan__MainLin__4CA06362]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan] ADD  CONSTRAINT [DF__LinkMan__MainLin__4CA06362]  DEFAULT ((0)) FOR [MainLinkMan]
GO
/****** Object:  Default [DF__LinkMan__Birthda__4D94879B]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan] ADD  CONSTRAINT [DF__LinkMan__Birthda__4D94879B]  DEFAULT ((1)) FOR [BirthdayType]
GO
/****** Object:  Default [DF__LinkMan__DeleteM__4E88ABD4]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan] ADD  CONSTRAINT [DF__LinkMan__DeleteM__4E88ABD4]  DEFAULT ((0)) FOR [DeleteMark]
GO
/****** Object:  Default [DF__LinkMan__Enabled__4F7CD00D]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan] ADD  CONSTRAINT [DF__LinkMan__Enabled__4F7CD00D]  DEFAULT ((1)) FOR [Enabled]
GO
/****** Object:  Default [DF__LinkMan__CreateO__5070F446]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan] ADD  CONSTRAINT [DF__LinkMan__CreateO__5070F446]  DEFAULT (getdate()) FOR [CreateOn]
GO
/****** Object:  Default [DF__IncomingC__CallD__619B8048]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall] ADD  CONSTRAINT [DF__IncomingC__CallD__619B8048]  DEFAULT (getdate()) FOR [CallDate]
GO
/****** Object:  Default [DF_IncomingCall_Handled]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall] ADD  CONSTRAINT [DF_IncomingCall_Handled]  DEFAULT ((0)) FOR [Handled]
GO
/****** Object:  Default [DF__IncomingC__Delet__628FA481]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall] ADD  CONSTRAINT [DF__IncomingC__Delet__628FA481]  DEFAULT ((0)) FOR [DeleteMark]
GO
/****** Object:  Default [DF__IncomingC__Enabl__6383C8BA]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall] ADD  CONSTRAINT [DF__IncomingC__Enabl__6383C8BA]  DEFAULT ((1)) FOR [Enabled]
GO
/****** Object:  Default [DF__IncomingC__Creat__6477ECF3]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall] ADD  CONSTRAINT [DF__IncomingC__Creat__6477ECF3]  DEFAULT (getdate()) FOR [CreateOn]
GO
/****** Object:  ForeignKey [FK_CustomerClass_ParentId]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[CustomerClass]  WITH CHECK ADD  CONSTRAINT [FK_CustomerClass_ParentId] FOREIGN KEY([ParentId])
REFERENCES [dbo].[CustomerClass] ([Id])
GO
ALTER TABLE [dbo].[CustomerClass] CHECK CONSTRAINT [FK_CustomerClass_ParentId]
GO
/****** Object:  ForeignKey [FK_CustomerClass_CostomerId]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[Customer]  WITH CHECK ADD  CONSTRAINT [FK_CustomerClass_CostomerId] FOREIGN KEY([CustomerClassID])
REFERENCES [dbo].[CustomerClass] ([Id])
GO
ALTER TABLE [dbo].[Customer] CHECK CONSTRAINT [FK_CustomerClass_CostomerId]
GO
/****** Object:  ForeignKey [FK_CustomerLinkMan_CustomerId]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[LinkMan]  WITH CHECK ADD  CONSTRAINT [FK_CustomerLinkMan_CustomerId] FOREIGN KEY([CustomerId])
REFERENCES [dbo].[Customer] ([Id])
GO
ALTER TABLE [dbo].[LinkMan] CHECK CONSTRAINT [FK_CustomerLinkMan_CustomerId]
GO
/****** Object:  ForeignKey [FK_INCOMING_CUSTOMER_ID]    Script Date: 05/03/2016 15:49:58 ******/
ALTER TABLE [dbo].[IncomingCall]  WITH CHECK ADD  CONSTRAINT [FK_INCOMING_CUSTOMER_ID] FOREIGN KEY([CustomerId])
REFERENCES [dbo].[Customer] ([Id])
GO
ALTER TABLE [dbo].[IncomingCall] CHECK CONSTRAINT [FK_INCOMING_CUSTOMER_ID]
GO
