declare @a Int,
set @a=(SELECT TOP 1 UserTableID + 1 AS FisNo FROM ET_MalzemeveHareketleri order by UserTableID desc) select @a
this is the code I have a table id of 4000 thousand I want to put the last number in @a variable
>Solution :
Do something like this
declare @a Int;
select @a = colname
from table
where ...
;