27,579
社区成员
发帖
与我相关
我的任务
分享
ALTER PROCEDURE [dbo].[P_Chat_Sel_Update]
@itID int,
@strPid nvarchar(50),
@strMstTo nvarchar(50)
AS
BEGIN
select top 1 ID,msg,date from chat where pid=@strPid and msgTo=@strMstTo and isread=0
--参数@itID等于上面查询出来的ID,上面那个查询任然要执行出结果
set @itID=???
UPDATE chat set isread=1 where ID =208;
END
ALTER PROCEDURE [dbo].[P_Chat_Sel_Update]
@itID int,
@strPid nvarchar(50),
@strMstTo nvarchar(50)
AS
BEGIN
select top 1 @itID=ID from chat where pid=@strPid and msgTo=@strMstTo and isread=0
UPDATE chat set isread=1 where ID =@itID
select top 1 ID,msg,date from chat where pid=@strPid and msgTo=@strMstTo and isread=0
END
ALTER PROCEDURE [dbo].[P_Chat_Sel_Update]
@itID int output,
@strPid nvarchar(50),
@strMstTo nvarchar(50)
AS
BEGIN
select top 1 @itID=ID from chat where pid=@strPid and msgTo=@strMstTo and isread=0
select top 1 ID,msg,date from chat where pid=@strPid and msgTo=@strMstTo and isread=0
UPDATE chat set isread=1 where ID =208;
END