>> INSERT INTO #TempTableOutput
EXEC (@select + @from + @where + @order);
How could I then loop through the records [sic] of #TempTableOutput to
update some blank fields [sic] that were created in the intial select
statement? <<
Columns are not anything like fields; rows are not anything like
records. Materializing a temp table is a bad programming practice to
be avoided. Dynamic SQL is a bad programming practice to be avoided.
You have no idea what the result will be until run time! You cannot
even give this thing a valid data element name (is it Briteny Spears,
automobiles or squid this execution?)
Wha you have is an attempt to mimic a scrath tape the way we did with
1950's-60'S programming languages when storage was limited. This is
not RDBMS at all!
What are you actually trying to do? You probably need more help than
you will find in a newsgroup, but we can try.
>> Stay informed about: How to loop a temp table?