SQL Server Forums – set @var = exec @sql.
go
create table #temp (Heat varchar(30))
declare @sql varchar(100)
declare @Heat varchar(30)
select @sql = 'insert into #temp select top 1 name from sysobjects'
exec (@sql)
select @Heat = Heat from #temp
select @Heat
drop table #temp