My database allows User Defined Fields(UDF) and during select, I want to combine the regular table fields with the UDFs in another table. Here is an example.
Table Person
Id FirstName LastName
1 John Smith
2 Jim Adams
Table UDF
PersonId FieldName FieldValue
2 Age 28
2 Status Available
Result of query
Id FirstName LastName Age Status
1 John Smith NULL NULL
2 Jim Adams 28 Avalable
I am using SQL server 2008 and would like to see a sample using Pivot or UnPivot.
Thanks