Hello,
Now I want to concatenate the pin numbers which I have underlined in the code.
But somehow it does not.
What's the correct way
Kindly help
Regards
cmrhema
Now I want to concatenate the pin numbers which I have underlined in the code.
But somehow it does not.
What's the correct way
Kindly help
Regards
cmrhema
Code:
declare @CrdPinNo varchar(100)
declare @CrdNo nvarchar(100)
declare @count int
declare @inc int
declare @concat nvarchar(200)
declare @Result nvarchar(50)
declare @desc nvarchar(500)
select @count=count(cardno) from vendorcardvalidation where cardvalue=1500 and flag=0
print @count
if (@count)>2
begin
declare cur1 cursor for
select top(2) pin,cardno from vendorcardvalidation where cardvalue=1500 and flag=0 order by cardno
open cur1
fetch next from cur1 into @CrdPinNo,@CrdNo
while(@@fetch_status=0)
begin
update vendorcardvalidation set flag=1 where cardno=@CrdNo
[U]select @concat='@concat'+@CrdPinNo[/U]
print @concat
fetch next from cur1 into @CrdPinNo,@CrdNo
end
close cur1
deallocate cur1
set @desc=@concat
set @Result='Success'
print @desc
end
else
begin
set @desc='Inadequate numbers'
set @Result='Failure'
end
Comment