I\'ve got some data in the following format:
-1,-1,-1,-1,701,-1,-1,-1,-1,-1,304,390,403,435,438,439,442,455
I need to insert it into a temp
You can create a query dynamically like this:
declare @sql varchar(1000) set @sql = 'insert into #TEMP select ' + replace(@values, ',', ' union all select ') exec @sql
As always when creating queries dynamically, you have to be careful so that you only use trusted data.