/****** Object:  View dbo.vfcm_branch    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_branch]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_branch]
GO

/****** Object:  View dbo.vfcm_chatroom_admin    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_chatroom_admin]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_chatroom_admin]
GO

/****** Object:  View dbo.vfcm_chatroom_consume    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_chatroom_consume]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_chatroom_consume]
GO

/****** Object:  View dbo.vfcm_chatroom_doc    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_chatroom_doc]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_chatroom_doc]
GO

/****** Object:  View dbo.vfcm_cluster    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_cluster]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_cluster]
GO

/****** Object:  View dbo.vfcm_cluster_admin    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_cluster_admin]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_cluster_admin]
GO

/****** Object:  View dbo.vfcm_cluster_doc    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_cluster_doc]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_cluster_doc]
GO

/****** Object:  View dbo.vfcm_cluster_user    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_cluster_user]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_cluster_user]
GO

/****** Object:  View dbo.vfcm_user_friend    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_user_friend]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_user_friend]
GO

/****** Object:  View dbo.vfcm_sms_info    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vfcm_sms_info]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[vfcm_sms_info]
GO

/****** Object:  Table [dbo].[fcm_allow_connect]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_allow_connect]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_allow_connect]
GO

/****** Object:  Table [dbo].[fcm_black_user]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_black_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_black_user]
GO

/****** Object:  Table [dbo].[fcm_book_group]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_book_group]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_book_group]
GO

/****** Object:  Table [dbo].[fcm_bulletin]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_bulletin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_bulletin]
GO

/****** Object:  Table [dbo].[fcm_b2b_bulletin]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_b2b_bulletin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_b2b_bulletin]
GO

/****** Object:  Table [dbo].[fcm_chatroom]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_chatroom]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_chatroom]
GO

/****** Object:  Table [dbo].[fcm_chatroom_admin]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_chatroom_admin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_chatroom_admin]
GO

/****** Object:  Table [dbo].[fcm_chatroom_consume]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_chatroom_consume]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_chatroom_consume]
GO

/****** Object:  Table [dbo].[fcm_chatroom_doc]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_chatroom_doc]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_chatroom_doc]
GO

/****** Object:  Table [dbo].[fcm_chatroom_platform]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_chatroom_platform]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_chatroom_platform]
GO

/****** Object:  Table [dbo].[fcm_cluster]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster]
GO

/****** Object:  Table [dbo].[fcm_cluster_admin]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster_admin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster_admin]
GO

/****** Object:  Table [dbo].[fcm_cluster_doc]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster_doc]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster_doc]
GO

/****** Object:  Table [dbo].[fcm_cluster_leaveword]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster_leaveword]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster_leaveword]
GO

/****** Object:  Table [dbo].[fcm_cluster_platform]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster_platform]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster_platform]
GO

/****** Object:  Table [dbo].[fcm_cluster_user]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_cluster_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_cluster_user]
GO

/****** Object:  Table [dbo].[fcm_counseling]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_counseling]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_counseling]
GO

/****** Object:  Table [dbo].[fcm_enterprise]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_enterprise]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_enterprise]
GO

/****** Object:  Table [dbo].[fcm_leaveword]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_leaveword]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_leaveword]
GO

/****** Object:  Table [dbo].[fcm_peer_friends]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_peer_friends]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_peer_friends]
GO

/****** Object:  Table [dbo].[fcm_peer_platform]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_peer_platform]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_peer_platform]
GO

/****** Object:  Table [dbo].[fcm_peer_system]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_peer_system]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_peer_system]
GO

/****** Object:  Table [dbo].[fcm_sip_user]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_sip_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_sip_user]
GO

/****** Object:  Table [dbo].[fcm_sms_info]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_sms_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_sms_info]
GO

/****** Object:  Table [dbo].[fcm_telephone_book]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_telephone_book]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_telephone_book]
GO

/****** Object:  Table [dbo].[fcm_user_branch]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_branch]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_branch]
GO

/****** Object:  Table [dbo].[fcm_user_face]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_face]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_face]
GO

/****** Object:  Table [dbo].[fcm_user_friend]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_friend]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_friend]
GO

/****** Object:  Table [dbo].[fcm_user_group]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_group]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_group]
GO

/****** Object:  Table [dbo].[fcm_user_card]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_card]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_card]
GO

/****** Object:  Table [dbo].[fcm_user_info]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_info]
GO

/****** Object:  Table [dbo].[fcm_user_deny]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_deny]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_deny]
GO

/****** Object:  Table [dbo].[fcm_user_disable]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_disable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_disable]
GO

/****** Object:  Table [dbo].[fcm_user_cache]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_cache]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_cache]
GO

/****** Object:  Table [dbo].[fcm_user_login]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_login]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_login]
GO

/****** Object:  Table [dbo].[fcm_user_server]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_user_server]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_user_server]
GO

/****** Object:  Table [dbo].[fcm_web_url]    Script Date: 2011-1-27 21:12:45 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fcm_web_url]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fcm_web_url]
GO

/****** Object:  Table [dbo].[fcm_allow_connect]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_allow_connect] (
	[AllowSubSvrIP] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_black_user]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_black_user] (
	[UserID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_book_group]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_book_group] (
	[UserID] [int] NULL ,
	[GroupID] [int] NULL ,
	[GroupName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_bulletin]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_bulletin] (
	[BulletinID] [int] NULL ,
	[BulletinType] [int] NULL ,
	[BulletinMsg] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[BulletinURL] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_b2b_bulletin]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_b2b_bulletin] (
	[ID] [int] NULL ,
	[Type] [int] NULL ,
	[BeginTime] [smalldatetime] NULL ,
	[EndTime] [smalldatetime] NULL ,
	[ActiveTime] [smalldatetime] NULL ,
	[Duration] [int] NULL ,
	[ConsumeMoney] [int] NULL ,
	[UserID] [int] NULL ,
	[Price] [int] NULL ,
	[Title] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Message] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Url] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_chatroom]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_chatroom] (
	[ChatRoomID] [int] NULL ,
	[ChatRoomName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PlatformID] [int] NULL ,
	[ChatRoomPwd] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
	[ChatRoomBulletin] [nvarchar] (128) COLLATE Chinese_PRC_CI_AS NULL ,
	[ChatRoomType] [int] NULL ,
	[OwnerID] [int] NULL ,
	[OwnerPwd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TicketPrice] [int] NULL ,
	[StoreServer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[AD] [ntext] COLLATE Chinese_PRC_CI_AS NULL  
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_chatroom_admin]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_chatroom_admin] (
	[ChatRoomID] [int] NULL ,
	[ChatRoomAdminID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_chatroom_consume]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_chatroom_consume] (
	[UserID] [int] NULL ,
	[ChatRoomID] [int] NULL ,
	[ConsumeMoney] [int] NULL ,
	[GoodCount] [int] NULL ,
	[BuyTime] [smalldatetime] NULL ,
	[GoodType] [int] NULL ,
	[BuyType] [bit] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_chatroom_doc]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_chatroom_doc] (
	[FileID] [int] NULL ,
	[ChatRoomID] [int] NULL ,
	[FileName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileSize] [int] NULL ,
	[FileMemo] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileServer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CreateDT] [smalldatetime] NULL ,
	[OwnerID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_chatroom_platform]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_chatroom_platform] (
	[PlatformID] [int] NULL ,
	[PlatformName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster] (
	[ClusterID] [int] NULL ,
	[ClusterName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ClusterBulletin] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ClusterMemo] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ClusterType] [int] NULL ,
	[PlatformID] [int] NULL ,
	[OwnerID] [int] NULL ,
	[CreateDate] [smalldatetime] NULL ,
	[IsVerify] [bit] NOT NULL ,
	[StoreServer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LeavewordDay] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster_admin]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster_admin] (
	[ClusterID] [int] NULL ,
	[AdminID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster_doc]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster_doc] (
	[FileID] [int] NULL ,
	[ClusterID] [int] NULL ,
	[FileName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileSize] [int] NULL ,
	[FileMemo] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileServer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CreateDT] [smalldatetime] NULL ,
	[OwnerID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster_leaveword]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster_leaveword] (
	[ClusterID] [int] NULL ,
	[FromID] [int] NULL ,
	[ToID] [int] NULL ,
	[MsgDate] [smalldatetime] NULL ,
	[Message] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster_platform]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster_platform] (
	[PlatformID] [int] NULL ,
	[PlatformName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_cluster_user]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_cluster_user] (
	[ClusterID] [int] NULL ,
	[UserID] [int] NULL ,
	[NickName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_counseling]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_counseling] (
	[UserID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_enterprise]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_enterprise] (
	[BranchID] [int] NULL ,
	[BranchName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PBranchID] [int] NULL ,
	[AdminID] [int] NULL ,
	[MessageServer] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[StoreServer] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[LastModify] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_leaveword]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_leaveword] (
	[FromID] [int] NULL ,
	[ToID] [int] NULL ,
	[MsgType] [int] NULL ,
	[Message] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[MsgDate] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_peer_friends]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_peer_friends] (
	[Server] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[OwnerID] [int] NULL ,
	[GroupID] [int] NULL ,
	[FriendID] [int] NULL ,
	[FriendName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemoName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_peer_platform]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_peer_platform] (
	[Server] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PlatformID] [int] NULL ,
	[PlatformName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_peer_system]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_peer_system] (
	[Name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Server] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_sip_user]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_sip_user] (
	[UserID] [int] NULL ,
	[SIPUserID] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[SIPUserPwd] [nvarchar] (64) COLLATE Chinese_PRC_CI_AS NULL ,
	[SIPSvrIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Money] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_sms_info]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_sms_info] (
	[UserID] [int] NULL ,
	[PhoneNumbers] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[SmsContent] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[SendTime] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_telephone_book]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_telephone_book] (
	[UserID] [int] NULL ,
	[GroupID] [int] NULL ,
	[ContactName] [nvarchar] (128) COLLATE Chinese_PRC_CI_AS NULL ,
	[SipID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mobile] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FixPhone] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [bit] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_branch]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_branch] (
	[UserID] [int] NULL ,
	[BranchID] [int] NULL ,
	[Weight] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_face]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_face] (
	[UserID] [int] NULL ,
	[FaceName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileServer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_friend]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_friend] (
	[OwnerID] [int] NULL ,
	[FriendID] [int] NULL ,
	[GroupID] [int] NULL ,
	[Name] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_group]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_group] (
	[OwnerID] [int] NULL ,
	[GroupID] [int] NULL ,
	[GroupName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_card]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_card] (
	[UserID] [int] NOT NULL ,
	[UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Company] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Department] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [bit] NOT NULL ,
	[Mobile] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Phone] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Fax] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EMail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Addr] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Brief] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_info]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_info] (
	[UserID] [int] NOT NULL ,
	[UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserPwd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserNickname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BloodType] [tinyint] NULL ,
	[ConStellation] [tinyint] NULL ,
	[Career] [tinyint] NULL ,
	[ShengXiao] [tinyint] NULL ,
	[FinishSchool] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[HomePage] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Brief] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EMail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Address] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PostalCode] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FixedPhone] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mobile] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Birthday] [smalldatetime] NULL ,
	[Age] [tinyint] NULL ,
	[Sex] [bit] NOT NULL ,
	[Country] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Province] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[City] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ImgIdx] [tinyint] NULL ,
	[HasMoney] [int] NULL ,
	[PwdProtect] [bit] NOT NULL ,
	[ProtectText] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
	[RegTime] [smalldatetime] NULL ,
	[Member] [tinyint] NULL ,
	[OnlineTime] [int] NULL ,
	[Signature] [nvarchar] (64) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardStyle] [int] NULL ,
	[ThirdAccount] [nvarchar] (240) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_deny]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_deny] (
	[UserID] [int] NOT NULL ,
	[PeerID] [int] NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_disable]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_disable] (
	[UserID] [int] NOT NULL ,
	[PeerID] [int] NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_cache]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_cache] (
	[UserID] [int] NOT NULL ,
	[GroupCache] [int] default ((1)) ,
	[FriendCache] [int] default ((1)),
	[ClusterCache] [int] default ((1)),
	[DenyCache] [int] default ((1)),
	[DisableCache] [int] default ((1))
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_login]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_login] (
	[UserID] [int] NOT NULL ,
	[NatIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[InnerIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LastTime] [smalldatetime] NULL ,
	[Signature] [bit] NOT NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_user_server]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_user_server] (
	[UserID] [int] NULL ,
	[Type] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Server] [nvarchar] (128) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[fcm_web_url]    Script Date: 2011-1-27 21:12:46 ******/
CREATE TABLE [dbo].[fcm_web_url] (
	[Category] [int] NULL ,
	[LiveRoomID] [int] NULL ,
	[LiveName] [nvarchar] (128) COLLATE Chinese_PRC_CI_AS NULL ,
	[LiveURL] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[LiveMemo] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[OwnerID] [int] NULL ,
	[PublicDT] [smalldatetime] NULL 
) ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_branch    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_branch
AS
SELECT dbo.fcm_user_branch.BranchID, dbo.fcm_user_branch.UserID, dbo.fcm_user_branch.Weight,
      dbo.fcm_user_info.UserName, dbo.fcm_user_info.UserNickname, 
      dbo.fcm_user_info.ImgIdx, dbo.fcm_user_info.Member, dbo.fcm_user_info.Sex,
      dbo.fcm_user_info.OnlineTime, dbo.fcm_user_info.Signature,dbo.fcm_user_info.CardStyle
FROM dbo.fcm_user_info INNER JOIN
      dbo.fcm_user_branch ON dbo.fcm_user_info.UserID = dbo.fcm_user_branch.UserID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_chatroom_admin    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_chatroom_admin
AS
SELECT dbo.fcm_chatroom.PlatformID, dbo.fcm_chatroom.ChatRoomID, 
      dbo.fcm_chatroom_admin.ChatRoomAdminID
FROM dbo.fcm_chatroom_platform INNER JOIN
      dbo.fcm_chatroom ON 
      dbo.fcm_chatroom_platform.PlatformID = dbo.fcm_chatroom.PlatformID INNER JOIN
      dbo.fcm_chatroom_admin ON 
      dbo.fcm_chatroom.ChatRoomID = dbo.fcm_chatroom_admin.ChatRoomID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_chatroom_consume    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_chatroom_consume
AS
SELECT dbo.fcm_chatroom_consume.UserID, dbo.fcm_user_info.UserName, 
      dbo.fcm_chatroom_consume.ChatRoomID, 
      dbo.fcm_chatroom_consume.ConsumeMoney, 
      dbo.fcm_chatroom_consume.GoodType, dbo.fcm_chatroom_consume.GoodCount, 
      dbo.fcm_chatroom_consume.BuyType, dbo.fcm_chatroom_consume.BuyTime
FROM dbo.fcm_chatroom_consume CROSS JOIN
      dbo.fcm_user_info

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_chatroom_doc    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_chatroom_doc
AS
SELECT dbo.fcm_chatroom_platform.PlatformID AS PlatformID, dbo.fcm_chatroom_doc.*
FROM dbo.fcm_chatroom_platform INNER JOIN
      dbo.fcm_chatroom ON 
      dbo.fcm_chatroom_platform.PlatformID = dbo.fcm_chatroom.PlatformID INNER JOIN
      dbo.fcm_chatroom_doc ON 
      dbo.fcm_chatroom.ChatRoomID = dbo.fcm_chatroom_doc.ChatRoomID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_cluster    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_cluster
AS
SELECT dbo.fcm_cluster_user.UserID AS UserID, dbo.fcm_cluster.*
FROM dbo.fcm_cluster INNER JOIN
      dbo.fcm_cluster_user ON dbo.fcm_cluster.ClusterID = dbo.fcm_cluster_user.ClusterID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_cluster_admin    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_cluster_admin
AS
SELECT dbo.fcm_cluster.PlatformID AS PlatformID, dbo.fcm_cluster_admin.ClusterID AS ClusterID, 
      dbo.fcm_cluster_admin.AdminID AS AdminID, dbo.fcm_user_info.*
FROM dbo.fcm_cluster_admin INNER JOIN
      dbo.fcm_user_info ON 
      dbo.fcm_cluster_admin.AdminID = dbo.fcm_user_info.UserID INNER JOIN
      dbo.fcm_cluster ON dbo.fcm_cluster_admin.ClusterID = dbo.fcm_cluster.ClusterID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_cluster_doc    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_cluster_doc
AS
SELECT dbo.fcm_cluster.PlatformID AS PlatformID, dbo.fcm_cluster_doc.*
FROM dbo.fcm_cluster INNER JOIN
      dbo.fcm_cluster_doc ON dbo.fcm_cluster.ClusterID = dbo.fcm_cluster_doc.ClusterID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_cluster_user    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_cluster_user
AS
SELECT dbo.fcm_cluster_user.ClusterID AS ClusterID, 
      dbo.fcm_cluster_user.NickName AS NickName, dbo.fcm_user_info.*
FROM dbo.fcm_cluster_user INNER JOIN
      dbo.fcm_user_info ON dbo.fcm_cluster_user.UserID = dbo.fcm_user_info.UserID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_user_friend    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_user_friend
AS
SELECT dbo.fcm_user_friend.OwnerID, dbo.fcm_user_friend.GroupID, 
      dbo.fcm_user_friend.FriendID, dbo.fcm_user_info.UserName, 
      dbo.fcm_user_info.UserNickname, dbo.fcm_user_info.ImgIdx, 
      dbo.fcm_user_info.Member, dbo.fcm_user_info.Sex, dbo.fcm_user_friend.Name, 
      dbo.fcm_user_info.OnlineTime, dbo.fcm_user_info.Signature, dbo.fcm_user_info.CardStyle
FROM dbo.fcm_user_friend INNER JOIN
      dbo.fcm_user_info ON dbo.fcm_user_friend.FriendID = dbo.fcm_user_info.UserID

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  View dbo.vfcm_sms_info    Script Date: 2011-1-27 21:12:47 ******/
CREATE VIEW dbo.vfcm_sms_info
AS
SELECT dbo.fcm_user_info.UserID, dbo.fcm_user_info.UserName, 
      dbo.fcm_user_info.UserNickname, dbo.fcm_sms_info.PhoneNumbers, 
      dbo.fcm_sms_info.SmsContent, dbo.fcm_sms_info.SendTime
FROM dbo.fcm_sms_info CROSS JOIN
      dbo.fcm_user_info

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

