I am trying to dynamically specify the number of records to pull out from a table. Prior to this statement I have generated a variable number into @selection_size. The syntax below does not compile in a stored proc. Is there a means of accomplishing this?
Code:
select top @selection_size
from wfa_log a
where a.location_bldg_num = @location_bldg_num
and a.audit_customer_complete is null