February 17, 2012 at 9:34 am
I need to convert this data
Name Relationship Address
Adelberg Parent 22Mesa Dr
Courtney Guardian 29 Mesa Dr
berg Grandparent 36 Mainst
into
column1 column2 column3
Adelberg Courtney berg
Parent Guardian Grandparent
22 Mesa Dr 29 Mesa Dr 36 mainst
February 17, 2012 at 9:37 am
You will find answer here:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 17, 2012 at 9:39 am
Have you looked at Pivot and Unpivot in T-SQL? They'll probably do what you need.
Honestly, though, I usually leave that kind of thing up to the presentation layer. Easier and more flexible there.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply