I have a bunch of tables like this:
Lookup_HealthCheckupRisks ------------ ID Name 1 Anemia 2 Anorexic 3 Bulemic 4 Depression ... 122 Syphilis Pati
Use PIVOT TABLE Here - Microsoft and here - tutorial.
You will need hovewer to specify all the columns. But you can use sp_executesql command to use dynamic SQL.