October 21, 2009 at 8:44 am
hi
i want to write store procedure that it takes a "FileCode"
and add "1" to a field wich name is "DownloadCount" only in that record
i wrote this :
ALTER PROCEDURE [dbo].[DownloadCount_SP]
@FileCodesql int
AS BEGIN
select DownloadCount from [File]
where FileCode=@FileCodesql
update [File] set DownloadCount=DownloadCount+1
END
but it does not work successfully
could you please help me?
regards
October 21, 2009 at 8:46 am
Remove the select part and just keep this in your sp
update [File]
set DownloadCount=DownloadCount+1
Where FileCode = @FileCodesql
---------------------------------------------------------------------------------
October 21, 2009 at 8:58 am
thanks a lot. you solved my problem
October 21, 2009 at 9:12 am
ur welcome 🙂
---------------------------------------------------------------------------------
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply