中国数据急救中心 全国连锁组织:南京|武汉|长沙|重庆|海口|镇江|无锡|南通|盐城|蚌埠|苏州|淮安|泰州|张家港|宿迁|合肥|马鞍山.热线:4006184118
数据恢复 信息安全 电子取证

关于作者

网络推荐

QQ程序-QQ数据库详解2-qq聊天记录数据恢复

上一篇 / 下一篇  2009-07-15 11:39:16

GetFriendByGroupId根据分组ID返回该分组的好友

CREATE proc GetFriendByGroupId
(
@GroupId int
)
as
begin
select iFriendId,cUserName from FriendList,UserInf whereiGroupId=@GroupIdand FriendList.cFriendNum=UserInf.cQQNum
end
GO

GetFriendListDefault根据用户id获取所有默认分组的好友名单

CREATE proc GetFriendListDefault
(
@UserId char(8)
)
as
begin
declare @tempGroupId int
select @tempGroupId=iGroupId from GroupInf whereGroupOwner=@UserIdand cGroupName='我的好友'
select iFriendId,cUserName from FriendList,UserInf where FriendList.cFriendNum=UserInf.cQQNum andFriendList.cQQNum=@UserIdandiGroupId=@tempGroupId
return
end
GO

GetFriendLsit通过用户id获取好友列表

CREATE proc GetFriendLsit
(
@cQQNum char(8)
)
as
begin
select GroupInf.cGroupName,FriendList.cFriendNum,UserInf.cUserName
from GroupInf,FriendList,UserInf
where FriendList.iGroupId=GroupInf.iGroupId
and UserInf.cQQNum=FriendList.cFriendNum
andFriendList.cQQNum=@cQQNum
andGroupInf.GroupOwner=@cQQNum
end
GO

GetGroupInf根据用户id获取该用户的分组

CREATE proc GetGroupInf
(
@UserId char(8),
@Model int
)
as
begin
if @Model=1
begin
select iGroupId,cGroupName from GroupInfwhereGroupOwner=@UserId
end
else
begin
select iGroupId,cGroupName from GroupInfwhereGroupOwner=@UserIdand cGroupName!='我的好友'
end
end
GO

GetModelList根据用户名获取所有模块列表

create proc GetModelList
(
@ZoneOwner char(8)
)
as
begin
select iModeId,vcModeName from ArtModule wherecZoneOwner=@ZoneOwner
end

GO

GetUserNameByNumber通过用户号码获取用户名称

create proc GetUserNameByNumber
(
@UserNumber char(8)
)
as
begin
select cUserName from UserInf wherecQQNum=@UserNumber
end

GO

GetZoneInf

create proc GetZoneInf根据id获取空间资料
(
@Owner char(8)
)
as
begin
select vcZoneName,vcZoneBgImg,vsBgSound,tZoneDes,iStyId from ZoneInf wherecZoneOwner=@Owner
end

GO

MakeNewModel创建新的模块

create proc MakeNewModel
(
@ModelName varchar(20),--模板名称
@ModelOwner char(8),--模板所有者-QQ空间
@Result int output--0 失败,1成功
)
as
begin
if exists(select * from ArtModule wherecZoneOwner=@ModelOwnerandvcModeName=@ModelName)

--是否已经存在该模板
begin
set @Result=0
end
else
begin
insert into ArtModule(cZoneOwner,vcModeName) values(@ModelOwner,@ModelName)
set @Result=1
end
end

GO

ReadArt获取文章的具体信息-阅读文章

create proc ReadArt
(
@ArtId int
)
as
begin
declare @temp int
select @temp=iBrowseCount+1 from Art whereiArtId=@ArtId--浏览次数+1
update Art setiBrowseCount=@tempwhereiArtId=@ArtId
select iBrowseCount,tArtContent,cPubTime,vcArtName from Art whereiArtId=@ArtId
end

GO

RegUser添加新的用户

CREATE proc RegUser
(
@UserName char(10),--用户名
@UserPwd varchar(50),--密码
@UserNumber char(8) output--返回QQ号
)
as
begin
declare @temp char(8)
select @temp=max(cQQNum)+1 from UserInf
set @UserNumber=case
when len(@temp)=1 then'0000000'+@temp
when len(@temp)=2 then'000000'+@temp
when len(@temp)=3 then'00000'+@temp
when len(@temp)=4 then'0000'+@temp
when len(@temp)=5 then'000'+@temp
when len(@temp)=6 then'00'+@temp
when len(@temp)=7 then'0'+@temp
else @temp
end
insert into UserInf(cUserName,cQQNum,vcQuserPwd) values(@UserName,@UserNumber,@UserPwd)
exec CreateGroup @UserNumber,'我的好友'
return(@UserNumber)
end
GO


ReNameModel重命名模块

create proc ReNameModel
(
@ModelId int,
@ModelName varchar(20)
)
as
begin
update ArtModule setvcModeName=@ModelNamewhereiModeId=@ModelId
end

GO

SelectUserByName通过用户名查询用户

CREATE proc SelectUserByName
(
@UserName varchar(10)
)
as
begin
select cUserName,cQQNum from UserInf where cUserName like'%'+@UserName+'%'
end
GO

SelectUserByNum通过用户号码查询用户

create proc SelectUserByNum
(
@UserNum varchar(8)
)
as
begin
select cUserName,cQQNum from UserInf wherecQQNum=@UserNum
end

GO

UpDateGroupInf修改分组信息

CREATE proc UpDateGroupInf
(
@newName char(10),
@User char(8),
@GroupId int,
@Result int output
)
as
begin
if exists(select * from GroupInf wherecGroupName=@newNameandGroupOwner=@User)
begin
set @Result=0
end
else
begin
if exists(select * from GroupInf where cGroupName='我的好友' andiGroupId=@GroupId)
begin
set @Result=2
end
else
begin
update GroupInf setcGroupName=@newNamewhereiGroupId=@GroupId
set @Result=1
end
end
end
GO


数据恢复 信息安全 电子取证

TAG: 程序 数据恢复 数据库 详解 聊天

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)