Thanks Carl, I appreciate that much tighter code. Now what I need to do is to get the results into a 2 field table where the rows are filled from the cleaned up string like so 'Row1Col, Row1Co2, Row2Col, Row2Co2, Row3Col, Row3Co2' if I am being clear. I hope. I don't know how to loop through the recordset or create the two col table inside a SP.
I really appreciate your help.
[snip]
>Good start Joe, with several ammendments. You don't need a continuation character. Also, you don't need the SELECTs on the right side of the statement and you don't need the UNION. Try this:
>
>SET @ExecuteString = 'SELECT ' + REPLACE(REPLACE(REPLACE('?=&', '?',''), '=',',') , '&',',')
>
>Carl
~Joe Johnston USA
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams