CREATE TABLE Product_temp(Cust VARCHAR(25), Product VARCHAR(20), QTY INT) INSERT INTO Product_temp(Cust, Product, QTY) VALUES(KATE,VEG,2) SELECT * FROM Product_temp Now the answer needed as TYPE VALUES CUST KATE PRODUCT VEG QTY 2
select Type,value FROM (select cust = convert (varchar,cust),Product = convert (varchar,Product),QTY = convert (varchar,QTY) from Product_temp ) c UNPIVOT (Value FOR Type IN ([cust],[Product], [QTY] ) ) AS p
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)