Thread: Pivot?
View Single Post
  #1 (permalink)  
Old September 1st, 2009, 12:10 PM
bph bph is offline
Authorized User
Points: 409, Level: 7
Points: 409, Level: 7 Points: 409, Level: 7 Points: 409, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: , , .
Posts: 94
Thanks: 1
Thanked 0 Times in 0 Posts
Default Pivot?

Good Morning,

I have a 2 column table like below, where there is a variable number of procedure codes for hundreds of test codes:

TC PC
1234 ABC
1234 DEF
1234 GHI
1234 JKL
5678 MNO
5678 PQR

And I want to make it like this.

TC PC
1234 ABC, DEF, GHI, JKL
5678 MNO, PQR


There are 8 million rows in the table.

First, is it possible accomplish this with TSQL?

Any links that might assist my reserach would be great also.

Thanks in advance for any help, BPH

Last edited by bph : September 1st, 2009 at 12:16 PM.
Reply With Quote