if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Action]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Action]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Agent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Agent]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Bargain]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Bargain]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_BargainEm]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_BargainEm]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_CATEGORIES]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_CATEGORIES]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_ChairTalk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_ChairTalk]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Chart]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Chart]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_City]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_City]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Client]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Client]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Company]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Company]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Compete]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Compete]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Config]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Config]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_ConfigType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_ConfigType]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Country]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Country]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_DepartMent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_DepartMent]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_DepartTask]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_DepartTask]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Employee]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_File]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_File]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Image]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Image]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Knowledge]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Knowledge]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Leave]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Leave]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Linkman]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Linkman]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Meeting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Meeting]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Message]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Message]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_NeedMoney]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_NeedMoney]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_NeedReimb]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_NeedReimb]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Notes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Notes]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Orders]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Orders]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_OutSide]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_OutSide]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Project]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Project]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Provide]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Provide]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Province]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Province]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Service]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Service]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_ShortBoard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_ShortBoard]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_Task]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_Task]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Wsdn_StarCRM_WorkLogs]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Wsdn_StarCRM_WorkLogs]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Action] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_CoName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Way] [nvarchar] (300) NULL ,
	[Wsdn_StarCRM_FromTime] [datetime] NULL ,
	[Wsdn_StarCRM_ToTime] [datetime] NULL ,
	[Wsdn_StarCRM_Rate] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[IsNotify] [char] (1) NULL ,
	[BeforeMinute] [int] NULL ,
	[BeforeHour] [int] NULL ,
	[BeforeDay] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Agent] (
	[Wsdn_StarCRM_id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NOT NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_TimeLimit] [datetime] NULL ,
	[Wsdn_StarCRM_Linkman] [int] NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_City] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Region] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Country] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Province] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BankAccount] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Mail] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Bargain] (
	[Wsdn_StarCRM_id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NOT NULL ,
	[Wsdn_StarCRM_subscribe] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_A] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_B] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Aagent] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bagent] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ASignDate] [datetime] NULL ,
	[Wsdn_StarCRM_BSginDate] [datetime] NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_BargainEm] (
	[Wsdn_StarCRM_id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NOT NULL ,
	[Wsdn_StarCRM_subscribe] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_A] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_B] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Aagent] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bagent] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ASignDate] [datetime] NULL ,
	[Wsdn_StarCRM_BSginDate] [datetime] NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_CATEGORIES] (
	[CategoryID] [int] NOT NULL ,
	[ParentCategoryID] [int] NULL ,
	[CategoryName] [nvarchar] (50) NULL ,
	[URL] [nvarchar] (50) NULL ,
	[Model] [nvarchar] (50) NULL ,
	[RightCode] [int] NULL ,
	[Serial] [int] NULL ,
	[TARGET] [nvarchar] (10) NULL ,
	[IMAGEURL] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_ChairTalk] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ChairMan] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_JionMan] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Pay] [decimal](19, 2) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Chart] (
	[ProductID] [int] NOT NULL ,
	[CategoryID] [int] NULL ,
	[ProductName] [nvarchar] (75) NOT NULL ,
	[SaleAmount] [money] NOT NULL ,
	[Times] [int] NULL ,
	[Ename] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_City] (
	[ID] [float] NULL ,
	[City] [nvarchar] (20) NULL ,
	[ProvinceID] [int] NULL ,
	[PYCoding] [nvarchar] (20) NULL ,
	[AreaCoding] [nvarchar] (10) NULL ,
	[ZIP] [nvarchar] (10) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Client] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ClinetType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Character] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Vocation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Relation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_FirstTime] [datetime] NULL ,
	[Wsdn_StarCRM_LatelyTime] [datetime] NULL ,
	[Wsdn_StarCRM_Country] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Provine] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Region] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_City] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Email] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mproduct] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Muser] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Pdetp] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mdept] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Corporation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Manager] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Peoples] [int] NULL ,
	[Wsdn_StarCRM_Turnover] [money] NULL ,
	[Wsdn_StarCRM_RegTime] [datetime] NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BankAccount] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fstatus] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Farea] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Tax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Recorder] [nvarchar] (50) NULL ,
	[Deleteflag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[Locked] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Company] (
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Director] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Manager] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BuildTime] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Email] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_EmployeeNum] [int] NULL ,
	[Wsdn_StarCRM_RegMoney] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Corporation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_Smtp] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_SmtpPassword] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (100) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (100) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Compete] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_City] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Region] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Country] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Province] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BankAccount] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mail] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_JionTime] [datetime] NULL ,
	[Wsdn_StarCRM_LimitTime] [datetime] NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Config] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Ctype] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Num] [decimal](18, 0) NULL ,
	[Wsdn_StarCRM_info] [nvarchar] (50) NULL ,
	[Deleteflag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_ConfigType] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Ctype] [nvarchar] (50) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Country] (
	[ID] [float] NULL ,
	[Country] [nvarchar] (255) NULL ,
	[PYCoding] [nvarchar] (255) NULL ,
	[Coding] [nvarchar] (255) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_DepartMent] (
	[DepartMentCode] [int] IDENTITY (1, 1) NOT NULL ,
	[Name] [nvarchar] (50) NULL ,
	[Manager] [nvarchar] (50) NULL ,
	[Phone] [nvarchar] (50) NULL ,
	[Fax] [nvarchar] (50) NULL ,
	[Address] [nvarchar] (150) NULL ,
	[Postnum] [nvarchar] (50) NULL ,
	[Btime] [datetime] NULL ,
	[Info] [nvarchar] (250) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_DepartTask] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_TO] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Percent] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Problem] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Employee] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Sex] [char] (2) NULL ,
	[PassWord] [nvarchar] (50) NULL ,
	[RightCode] [nvarchar] (50) NULL ,
	[RoleCode] [nvarchar] (50) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[PageSizeB] [int] NULL ,
	[PageSizeS] [int] NULL ,
	[Css] [nvarchar] (150) NULL ,
	[NavType] [nvarchar] (10) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_EngageType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_SalaryType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Salary] [money] NULL ,
	[Wsdn_StarCRM_Postion] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Tech] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_JoinCompanyTime] [datetime] NULL ,
	[Wsdn_StarCRM_FirstWorkTime] [datetime] NULL ,
	[Wsdn_StarCRM_Politi] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Ismerry] [char] (1) NULL ,
	[Wsdn_StarCRM_OfficePlace] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BargainBeginTime] [datetime] NULL ,
	[Wsdn_StarCRM_BargainEndTime] [datetime] NULL ,
	[Wsdn_StarCRM_GoodAt] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_LeaveTime] [datetime] NULL ,
	[Wsdn_StarCRM_School] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Speciality] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Degree] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Graduate] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_EduLanguage] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_EduLangLevel] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_EduComputer] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_EduInfo] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OldName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Ename] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Cphone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mobile] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Email] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_ICQ] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OICQ] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_MSN] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_LT] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_CreatedTime] [datetime] NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_RegPlace] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_NationPlace] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Nation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fphone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Birthday] [datetime] NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BankAccount] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_MateName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ContactName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ContactPhone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Identity] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_SocietyNO] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_MedicaNO] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsStay] [char] (1) NULL ,
	[Wsdn_StarCRM_Image] [image] NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[Locked] [char] (1) NULL ,
	[IsOnline] [char] (1) NULL ,
	[Status] [nvarchar] (20) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_File] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ContentType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Size] [int] NULL ,
	[Wsdn_StarCRM_Ole] [image] NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (100) NULL ,
	[Wsdn_StarCRM_Class] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Uploader] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Image] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (100) NULL ,
	[Wsdn_StarCRM_ContentType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Size] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Class] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Uploader] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Knowledge] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (100) NULL ,
	[Wsdn_StarCRM_Class] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Locked] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Leave] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (15) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OKTime] [datetime] NULL ,
	[Wsdn_StarCRM_OKMan] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Linkman] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Sex] [char] (2) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Dept] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Class] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Work] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postion] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Tech] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mobile] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Email] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Birthday] [datetime] NULL ,
	[Wsdn_StarCRM_Country] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_City] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Like] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_FirstTime] [datetime] NULL ,
	[Wsdn_StarCRM_LatelyTime] [datetime] NULL ,
	[Wsdn_StarCRM_Image] [image] NULL ,
	[Wsdn_StarCRM_Salary] [money] NULL ,
	[Wsdn_StarCRM_NationPlace] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Nation] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Mate] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ContactName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ContactPhone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Identity] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ATM] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ICQ] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OICQ] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_MSN] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_LT] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_IsMailList] [char] (1) NULL ,
	[Wsdn_StarCRM_IsWeb] [char] (1) NULL ,
	[Wsdn_StarCRM_Password] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_LastLoginTime] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Recorder] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Locked] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Meeting] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (150) NOT NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_People] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Chair] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Locked] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Message] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_From] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_To] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (100) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_ReadTime] [datetime] NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Status] [nvarchar] (6) NULL ,
	[Wsdn_StarCRM_Email] [nvarchar] (120) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (250) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_NeedMoney] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (15) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OKTime] [datetime] NULL ,
	[Wsdn_StarCRM_OKMan] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_NeedReimb] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (15) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OKTime] [datetime] NULL ,
	[Wsdn_StarCRM_OKMan] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Notes] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL ,
	[NotifyTime] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Orders] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NOT NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BookTime] [datetime] NOT NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_CarrTime] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_CarrType] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_CarrMoney] [money] NULL ,
	[Wsdn_StarCRM_Tax] [decimal](18, 0) NULL ,
	[Wsdn_StarCRM_Status] [nvarchar] (12) NULL ,
	[Deleteflag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_OutSide] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_OKTime] [datetime] NULL ,
	[Wsdn_StarCRM_OKMan] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Project] (
	[ProjectId] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Order] [nvarchar] (50) NULL ,
	[SumCount] [money] NULL ,
	[StartTime] [datetime] NULL ,
	[EndTime] [datetime] NULL ,
	[Info] [ntext] NULL ,
	[DeleteFlag] [char] (1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Provide] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [int] NULL ,
	[Wsdn_StarCRM_Address] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_City] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Region] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Postnum] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Country] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Province] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Phone] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Fax] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Bank] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_BankAccount] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_URL] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Mail] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_TimeLimit] [datetime] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Province] (
	[ID] [float] NULL ,
	[Province] [nvarchar] (255) NULL ,
	[CountryID] [float] NULL ,
	[PYCoding] [nvarchar] (255) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Service] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_CoName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Type] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Way] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Rate] [nvarchar] (16) NULL ,
	[Wsdn_StarCRM_FromTime] [datetime] NULL ,
	[Wsdn_StarCRM_ToTime] [datetime] NULL ,
	[Wsdn_StarCRM_Money] [money] NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Project] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_ShortBoard] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Title] [nvarchar] (30) NULL ,
	[Wsdn_StarCRM_Author] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Rate] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Employee] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Info] [ntext] NULL ,
	[Wsdn_StarCRM_IsCompany] [char] (1) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_Task] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (80) NOT NULL ,
	[Wsdn_StarCRM_From] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_TO] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_StartTime] [datetime] NULL ,
	[Wsdn_StarCRM_EndTime] [datetime] NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Percent] [nvarchar] (5) NULL ,
	[Wsdn_StarCRM_Prior] [nvarchar] (12) NULL ,
	[Wsdn_StarCRM_Value] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Problem] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_WriteTime] [datetime] NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_IsChecked] [char] (1) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Wsdn_StarCRM_WorkLogs] (
	[Wsdn_StarCRM_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Wsdn_StarCRM_Name] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_CoName] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Time] [datetime] NULL ,
	[Wsdn_StarCRM_Info] [nvarchar] (500) NULL ,
	[Wsdn_StarCRM_Result] [nvarchar] (150) NULL ,
	[Wsdn_StarCRM_Way] [nvarchar] (250) NULL ,
	[Wsdn_StarCRM_From] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_FromTime] [datetime] NULL ,
	[Wsdn_StarCRM_To] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_ToTime] [datetime] NULL ,
	[Wsdn_StarCRM_Client] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Linkman] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_Money] [money] NULL ,
	[Wsdn_StarCRM_Department] [nvarchar] (50) NULL ,
	[Wsdn_StarCRM_IsPublic] [char] (1) NULL ,
	[DeleteFlag] [char] (1) NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Action] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Action] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Agent] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Agent] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_ConfigType] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_ConfigType] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Ctype]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_DepartMent] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_DepartMent] PRIMARY KEY  CLUSTERED 
	(
		[DepartMentCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_DepartTask] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_DepartTask] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Leave] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Leave] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_NeedMoney] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_NeedMoney] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_NeedReimb] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_NeedReimb] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Notes] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Notes] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_OutSide] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_OutSide] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Service] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Service] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_ShortBoard] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_ShortBoard] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Task] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_Task] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_WorkLogs] WITH NOCHECK ADD 
	CONSTRAINT [PK_Wsdn_StarCRM_WorkLogs] PRIMARY KEY  CLUSTERED 
	(
		[Wsdn_StarCRM_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Action] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Action_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_Action_BeforeMinute] DEFAULT (0) FOR [BeforeMinute],
	CONSTRAINT [DF_Wsdn_StarCRM_Action_BeforeHour] DEFAULT (0) FOR [BeforeHour],
	CONSTRAINT [DF_Wsdn_StarCRM_Action_BeforeDay] DEFAULT (0) FOR [BeforeDay]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Agent] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Agent_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Bargain] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Bargain_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_BargainEm] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_BargainEm_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_ChairTalk] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_ChairTalk_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Client] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Client_Deleteflag] DEFAULT ('N') FOR [Deleteflag],
	CONSTRAINT [DF_Wsdn_StarCRM_Client_Wsdn_StarCRM_IsPublic] DEFAULT ('N') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Client_Locked] DEFAULT ('N') FOR [Locked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_DepartTask] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_DepartTask_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_DepartTask_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Employee] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_Wsdn_StarCRM_Sex] DEFAULT ('男') FOR [Wsdn_StarCRM_Sex],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_PassWord] DEFAULT (1) FOR [PassWord],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_RightCode] DEFAULT (N'人事,办公') FOR [RightCode],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_RoleCode] DEFAULT (N'只读用户') FOR [RoleCode],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_PageSizeB] DEFAULT (18) FOR [PageSizeB],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_PageSizeS] DEFAULT (6) FOR [PageSizeS],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_Css] DEFAULT (N'../css/wsdnorgstd1.css') FOR [Css],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_NavType] DEFAULT (N'menu') FOR [NavType],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_Locked] DEFAULT ('N') FOR [Locked],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_IsOnline] DEFAULT ('N') FOR [IsOnline],
	CONSTRAINT [DF_Wsdn_StarCRM_Employee_Status] DEFAULT (N'新建员工尚未登陆') FOR [Status]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_File] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_File_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Knowledge] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Knowledge_Locked] DEFAULT ('N') FOR [Locked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Leave] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Leave_Wsdn_StarCRM_OKTime] DEFAULT (getdate()) FOR [Wsdn_StarCRM_OKTime],
	CONSTRAINT [DF_Wsdn_StarCRM_Leave_Wsdn_StarCRM_IsNPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Leave_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_Leave_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Linkman] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Linkman_Wsdn_StarCRM_IsPublic] DEFAULT ('N') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Linkman_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_Linkman_Locked] DEFAULT ('N') FOR [Locked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Meeting] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Meeting_Locked] DEFAULT ('N') FOR [Locked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Message] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Message_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_NeedMoney] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_NeedMoney_Wsdn_StarCRM_OKTime] DEFAULT (getdate()) FOR [Wsdn_StarCRM_OKTime],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedMoney_Wsdn_StarCRM_IsNPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedMoney_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedMoney_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_NeedReimb] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_NeedReimb_Wsdn_StarCRM_OKTime] DEFAULT (getdate()) FOR [Wsdn_StarCRM_OKTime],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedReimb_Wsdn_StarCRM_IsNPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedReimb_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_NeedReimb_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Notes] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Notes_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Notes_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_Notes_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_OutSide] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_OutSide_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_OutSide_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag],
	CONSTRAINT [DF_Wsdn_StarCRM_OutSide_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Service] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Service_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_Service_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_ShortBoard] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_ShortBoard_Wsdn_StarCRM_IsCompany] DEFAULT ('N') FOR [Wsdn_StarCRM_IsCompany],
	CONSTRAINT [DF_Wsdn_StarCRM_ShortBoard_Wsdn_StarCRM_IsPublic] DEFAULT ('Y') FOR [Wsdn_StarCRM_IsPublic],
	CONSTRAINT [DF_Wsdn_StarCRM_ShortBoard_DeleteFlag] DEFAULT ('N') FOR [DeleteFlag]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_Task] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_Task_Wsdn_StarCRM_IsChecked] DEFAULT ('N') FOR [Wsdn_StarCRM_IsChecked]
GO

ALTER TABLE [dbo].[Wsdn_StarCRM_WorkLogs] WITH NOCHECK ADD 
	CONSTRAINT [DF_Wsdn_StarCRM_WorkLogs_Wsdn_StarCRM_Money] DEFAULT (0) FOR [Wsdn_StarCRM_Money]
GO

