Home Forums SQL Server 2008 T-SQL (SS2K8) how to store result at variable? RE: how to store result at variable?
Durai Samuel
Mr or Mrs. 500
Points: 551
More actions
August 1, 2013 at 5:11 am
#1637731
You can use an output parameter to get the result
create proc sp_temp
@count INT OUTPUT = NULL
as
begin
declare @Result varchar(5)
select @count = COUNT(*) from #temptable
end
Now your @count variable will have the count result