By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Create table #tempTable2 (Location1 decimal(10,2), Location2 Decimal(10,2), Location3 decimal(10,2), Location4 decimal(10,2),
Location5 Decimal(10,2))
Insert into #temptable2 Values ('22.4','33.4', '12.4', '95.94','23.40')
1 rows affected
SELECT y.Location, y.Amount
FROM #tempTable2 AS t2
CROSS APPLY (VALUES('Location1', Location1),
('Location2', Location2),
('Location3', Location3),
('Location4', Location4),
('Location5', Location5)
) AS y(Location,Amount);
Location | Amount |
---|---|
Location1 | 22.40 |
Location2 | 33.40 |
Location3 | 12.40 |
Location4 | 95.94 |
Location5 | 23.40 |