This is my table:
CaseID AttributeName AttributeValue
03E07546-9C10-4399-B840-04F9CE211FB8 Case Title deepa04
03E07546-9C10-4399-B840-04F9CE211FB8 Body Part hand
03E07546-9C10-4399-B840-04F9CE211FB8 Diagnosis 123
E999866E-E8BE-4442-8A87-C419D482022E Case Title deep_case
E999866E-E8BE-4442-8A87-C419D482022E Body Part leg
E999866E-E8BE-4442-8A87-C419D482022E Diagnosis 123
I need to convert this into:
CaseID Case Title Body Part Diagnosis
03E07546-9C10-4399-B840-04F9CE211FB8 deepa04 hand 123
E999866E-E8BE-4442-8A87-C419D482022E deep_case leg 123
How can I achieve this using dynamic pivot functions in SQL Server 2008?