i think the follwoing is the expected output.....DECLARE @data TABLE( Name varchar(50), VALUE varchar(100))insert into @dataSELECT 'ClientID', 'M01010001250' union allSELECT 'InterviewType', '1' union allSELECT 'InterviewDate', '7/8/2011' union allSELECT 'ClientID', 'M01010001260' union allSELECT 'InterviewType', '1' union allSELECT 'InterviewDate', '7/8/2011' union allSELECT 'ClientID', 'M01010001260' union allSELECT 'InterviewType', '5' union allSELECT 'InterviewDate', '1869-07-01' union allSELECT 'ClientID', 'M01010001290' union allSELECT 'InterviewType', '1' union allSELECT 'InterviewDate', '7/8/2011'SELECT SEQ,ClientID,InterviewType,InterviewDateFROM(SELECT ROW_NUMBER() OVER (PARTITION BY NAME ORDER BY (SELECT 1)) AS SEQ,NAME,VALUEFROM @data) DTPIVOT (MAX(VALUE)FOR NAME IN(ClientID,InterviewType,InterviewDate))DT1ORDER BY SEQ/* OUTPUT:SEQ ClientID InterviewType InterviewDate1 M01010001250 5 1869-07-012 M01010001260 1 7/8/20113 M01010001260 1 7/8/20114 M01010001290 1 7/8/2011*/
--Chandu