>
>Remove table_w_data from your first query:
>>>>cSQL = 'SELECT @Column2Get3=' + @Column2Get1 + ', @Column2Get4=' + @Column2Get2
>> .....
>>
>
>When I do I get:
>
>"Must declare the variable '@Column2Get3'."
>
>which I guess it means a scope problem as it runs in a separate batch.
Sorry, I copy and paste that from your first message, it should be:
cSQL = 'SELECT @Column2Get3Out=' + @Column2Get1 + ', @Column2Get4Out=' + @Column2Get2
...
The variables inside the string must be with the same name as these declared in @ParamDeff
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.