table name : mrinf
fields : companycode nchar(4), mrno (nchar(9), chqno nvarchar (50), tranamount decmal (18,2)
I have to update the several sequential (incremented by 1) mrno to a new squential mrno (incremented by 1)
therefore i have written a stored procedure
CREATE PROCEDURE dbo.changemr (@counter int, @prevmrno nchar(9), @newmrno nchar (9))
SET NOCOUNT ON;
[highlight=#ffff11]Declare @count int
select @count = @count+1
update mrinf set mrno=@newmrno where comcod=3305 and mrno=@prevmrno
but it is not giving the desired result.
For example I am executing the procedure by
exec dbo.mrchange 4, '000053345', '000001881'
result should be like this
Previous MR No and new MR NO
but not getting any result no change in the table. Can anybody help me to solve this problem.