要使表中某一字段加1的存储过程

ALTER PROCEDURE Addwrongtimes
@ID INT,
@count INT OUT
AS
BEGIN
SET @count = (SELECT wrongtimes FROM TB_TestpaperDownload WHERE ID=@ID)
SET @count = @count+1
UPDATE TB_TestpaperDownload SET WrongTimes=@count WHERE ID=@ID
END 
GO

 

posted @ 2013-05-22 10:08  梦醒心晴  Views(208)  Comments(0)    收藏  举报