/****** Object: Table [dbo].[Users] Script Date: 04/14/2011 21:42:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Users](
[Key] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](256) NOT NULL,
[Nickname] [nvarchar](256) NOT NULL,
[Type] [int] NOT NULL,
[Password] [nvarchar](256) NOT NULL,
[EMail] [nvarchar](256) NOT NULL,
[InviteCode] [nvarchar](256) NULL,
[UpperName] [nvarchar](256) NOT NULL,
[MsgFileLimit] [int] NULL,
[MsgImageLimit] [int] NULL,
[AcceptStrangerIM] [int] NULL,
[IsTemp] [int] NULL,
[DiskSize] [int] NULL,
[RegisterTime] [datetime] NOT NULL,
[HomePage] [nvarchar](256) NULL,
[HeadIMG] [nvarchar](512) NOT NULL,
[Remark] [text] NOT NULL,
PRIMARY KEY CLUSTERED
(
[Key] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[UpperName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[UserRelationship] Script Date: 04/14/2011 21:42:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserRelationship](
[HostKey] [int] NOT NULL,
[GuestKey] [int] NOT NULL,
[Relationship] [int] NOT NULL,
[RenewTime] [datetime] NOT NULL,
[Key] [int] IDENTITY(1,1) NOT NULL,
PRIMARY KEY CLUSTERED
(
[Key] 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
/****** Object: Table [dbo].[User_Role] Script Date: 04/14/2011 21:42:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User_Role](
[Key] [int] IDENTITY(1,1) NOT NULL,
[UserKey] [int] NOT NULL,
[RoleKey] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[Key] 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
/****** Object: Table [dbo].[Roles] Script Date: 04/14/2011 21:42:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Roles](
[Key] [int] NOT NULL,
[Name] [nvarchar](256) NOT NULL,
PRIMARY KEY CLUSTERED
(
[Key] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[Name] 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
/****** Object: Table [dbo].[Message] Script Date: 04/14/2011 21:42:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
[Key] [int] NOT NULL,
[CreatedTime] [datetime] NULL,
[Receiver] [int] NULL,
[Sender] [int] NULL,
[Content] [text] NULL,
PRIMARY KEY CLUSTERED
(
[Key] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: StoredProcedure [dbo].[Validate] Script Date: 04/14/2011 21:42:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[Validate](@name nvarchar(256), @password nvarchar(256))
as
begin
select * from Users where UpperName=upper(@name) and Password=@password
end
GO
/****** Object: StoredProcedure [dbo].[GetUserRoles] Script Date: 04/14/2011 21:42:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[GetUserRoles](@name nvarchar(256))
as
begin
select r.Name as Ro�
评论2
最新资源