这是存储过程:
ALTERPROCEDURE[dbo].[insertFriendGroup]
--Addtheparametersforthestoredprocedurehere
@GroupNamevarchar(50),
@Ownerqidvarchar(11),
@Groupidintoutput
AS
BEGIN
declare@Qidint
set@Qid=null
select@Qid=idfrom[user]whereqid=@Ownerqid
if@Qidisnull
set@Groupid=-1
else
begin
set@Qid=null
select@Qid=idfrom[qqmsg].[dbo].[FriendQIDFolder]where[ownerQid]=@Ownerqidand[FolderName]=@GroupName
if@Qidisnull
begin
INSERTINTO[qqmsg].[dbo].[FriendQIDFolder]
([ownerQid]
,[FolderName])
select@Ownerqid,@GroupName
selecttop1@Groupid=idfrom[FriendQIDFolder]where
[ownerQid]=@Ownerqidand[FolderName]=@GroupName
end
else
set@Groupid=-2
end
SETNOCOUNTON;
END
=============================这是asp文件==============================
response.buffer=true
'强制浏览器重新访问服务器下载页面,而不是从缓存读取页面
Response.Expires=-1
Response.ExpiresAbsolute=Now()-1
Response.Expires=0
Response.CacheControl="no-cache"
dimGroupName,Ownerqid
GroupName=request("GroupName"):GroupName=Checkstr(GroupName)
Ownerqid=request("Ownerqid"):Ownerqid=Checkstr(Ownerqid)
ifGroupName=""orOwnerqid=""then
response.write"err"
else
callStoreData()
endif
callCloseConn()
subStoreData()
onerrorresumenext
DimCmd
Setcmd=Server.CreateObject("ADODB.Command")
Setcmd.ActiveConnection=conn
cmd.CommandText="[insertFriendGroup]"
cmd.CommandType=4
cmd.Parameters.Appendcmd.CreateParameter("@GroupName",201,1,50)
cmd.Parameters.Appendcmd.CreateParameter("@Ownerqid",201,1,11)
cmd.Parameters.Appendcmd.CreateParameter("@Groupid",3,2,4)
cmd("@GroupName")=GroupName
cmd("@Ownerqid")=Ownerqid
Cmd.Execute
iferrthen
response.write"err"&err.description
else
response.writeCmd("@Groupid")
endif
endsub
%>
分 -->
|