I am trying to find the syntax for inserting the results from an UNPIVOT statement into an existing table in the database?
Asked
Active
Viewed 2,327 times
1 Answers
2
simplest answer which works for any SELECT including UNPIVOT would be...
INSERT INTO MyTable
SELECT statement
However, this does require that your destination tables columns match your SELECT statement columns.
Although you can get around this limitation with...
INSERT INTO MyTable (column1, column2....)
SELECT statement

Rich Andrews
- 4,168
- 3
- 35
- 48