Look at this code:
DECLARE @bufferOrder INT = 1, @capacityOrder INT = 2, @priceOrder INT = 3, @angleSpeedOrder INT = 4
SELECT 'buffer', @bufferOrder
UNION
SELECT 'capacity', @capacityOrder
UNION
SELECT 'price', @priceOrder
UNION
SELECT 'angle_speed', @angleSpeedOrder
Can I assign two column names without using a temporary table?
[INSERT INTO @#tempTabel (columnName1,columnName2) + above code]
In way like this (pseudo code):
above code +
AS columnName1,columnName2
Just assign the column names in your first select statement. EG:
I can easily add more things and more things to this. Column names are defined in first select statement and stay that way unless they are changed aliases.