Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

how to save the result set of a SELECT in a variable ?

$
0
0

declare aVal int, bVal int;

select min(d.DateValue) begindate, max(d.DateValue) enddate from dbo.dimDate d

where d.BusinessYear = 2014 

what I want to do is to save the result of the select statement in aVal and bVal 

so aVal=begindate and bVal=enddate


Viewing all articles
Browse latest Browse all 12890

Trending Articles