mister.magoo (3/5/2012)
This is one way...but almost certainly not the best way....works ok on a million rows
BEGIN TRAN ; -- just for repeatability
CREATE TABLE #DATA(ID INT, VALUE1 INT,VALUE2 INT,TYPE INT);
INSERT #DATA(ID,VALUE1,VALUE2,TYPE)
SELECT...