SELECT Results Generate INSERTS INTO Temp Table / Table Variable
How about a feature which would take a SELECT result, declare a Temp Table / Table Variable based on the schema of the result, and generate INSERT INTO statements?
I do this often when comparing data across disparate systems where the source data is scripted into a table variable to be compared in the destination system. I use a combination of CONCATs and a WHILE loop to handle the need for a trailing comma (if using VALUE), or trailing UNION if using SELECTs as insert into source.
1
vote
Anonymous
shared this idea