I'm quite new to writing SQL server stored procs.

Normally in an asp page I would write build my SQL statement dyanamically, adding column names and value names depending on values that had been passed to the page.

In SQL server I can dynamically add the value using a parameter, but it would seem to be the case the column names have to be hard coded. Is this true, or is there a way that I can dynamically build the column list on the basis of the parameters passed to the procedure?

Cheers.