I want to combine SQL query with temp table data like below. My sql query is
declare @temp table(Id int)
insert into @temp values(10)
insert into @temp values(20)
declare @SQL nvarchar(max)=''
set @SQL='select * from nomination where id in (select id from @temp)'
exec (@sql)
when execute above query, it throws error as Must declare the table variable "@temp". can any help to solve this?