The Data you see there seems to be the result of the query executed in the middle of your sp.
select Hotelname,Phoneno,Roomrate from Tb_Accommodation where Active <> 'D'
You should comment or delete this line.
and just before the
commit tran
add
select @final
But this won't show result because your variables are never used after declare.
But maybe what you wanted to was
select @Hotelname= Hotelname,@Phoneno= Phoneno,@Roomrate= Roomrate from Tb_Accommodation where Active <> 'D'
But, if I understand the result correctly, it looks like the query returns
2 rows, then you won't be able to assign these values into
1 variable.
Actually, none of your variable are assigned a value, you're checking:
<pre lang="SQL">if @Accommodation= ''
, but you only declared it before, this condition will always be true..
You should review your process first, because there is no logic in what you sent.