May be..CREATE TABLE #text(code varchar(MAX),Deductible varchar(MAX),DeductibleType varchar(MAX),varNotes varchar(MAX))INSERT INTO #textSELECT 'PREF',NULL,NULL, 'Ded applies' UNION ALLSELECT 'NPRF',NULL,'Per Policy Year',NULL UNION ALLSELECT 'NPRF','$500',NULL,NULL UNION ALLSELECT 'PREF',NULL,NULL, 'Ded ' UNION ALLSELECT 'NPRF',NULL,'Year',NULL UNION ALLSELECT 'PREF','$5400',NULL,NULL SELECT a.code , a.Deductible , b.DeductibleType , c.varNotesFROM ( SELECT t.code ,t.Deductible ,RowNum = ROW_NUMBER() OVER (ORDER BY (SELECT 1)) FROM #text t WHERE t.Deductible IS NOT NULL ) aINNER JOIN ( SELECT t.DeductibleType ,RowNum = ROW_NUMBER() OVER (ORDER BY (SELECT 1)) FROM #text t WHERE t.DeductibleType IS NOT NULL ) bON a.RowNum = b.RowNumINNER JOIN ( SELECT t.varNotes ,RowNum = ROW_NUMBER() OVER (ORDER BY (SELECT 1)) FROM #text t WHERE t.varNotes IS NOT NULL ) cON b.RowNum = c.RowNumDROP TABLE #text
---------------Murali KrishnaYou live only once ..If you do it right once is enough.......