Hi Saiansh,
Refer below query.
SQL
CREATE TABLE #Booking(UserEnquiry INT,UserBooking INT,UserTarget NUMERIC(18,2))
INSERT INTO #Booking VALUES(29,39,53218000.00)
SELECT UserEnquiry,UserBooking,UserTarget
into #tempt
FROM #Booking
SELECT 'UserEnquiry' AS 'Description',UserEnquiry AS 'Value' FROM #Booking
UNION
SELECT 'UserBooking',UserBooking FROM #Booking
UNION
SELECT 'UserTarget',UserTarget FROM #Booking
DROP TABLE #tempt
DROP TABLE #Booking
Output
Description Value
UserEnquiry 29
UserBooking 39
UserTarget 53218000.00
Or you can use AROSS APPLY.
CREATE TABLE #Booking(UserEnquiry INT,UserBooking INT,UserTarget NUMERIC(18,2))
INSERT INTO #Booking VALUES(29,39,53218000.00)
SELECT UserEnquiry,UserBooking,UserTarget
INTO #tempt
FROM #Booking
SELECT Description,Value
FROM #tempt
CROSS APPLY (SELECT UserEnquiry, 'UserEnquiry'
UNION
SELECT UserBooking, 'UserBooking'
UNION
SELECT UserTarget, 'UserTarget') U
(Value, Description)
DROP TABLE #tempt
DROP TABLE #Booking