PIVOT dynamic list

In SQl Server 2005 how can I have the list of fields I want to pivot on to be chosen from a table and not a predefined list of column names?

I don't want to use dynamic sql to built the query.

select *
from (select code from tbl_translations) as labels
            FOR Code IN (select code from tbl_codes)

Thank you.
Who is Participating?
miral13Author Commented:
Thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.