I'm looking ove rthis proc and i noticed theire using dynamic sql however instread of using ticks their using double quotes around the select string and assigning it to variable and executing it.
i didnt think u could do this. When i run it and try and print the string i get nothing. Anyone farmiliar w this method?
--example
set @sql_tmplt =
"
insert into
#ViewedOffers
select top " + cast(@speed_count as varchar) + "
ViewedOfferId,
PersonId,
ViewedDate,
''
from
dbo.InProcessVO with(nolock)
where
DeliveryDefId = " + cast(@p_DelivDefID as varchar)
print @sql_tmplt
--execute (@sql_tmplt)