I need to select all of the rows in a given table that match a criteria, and them add them back onto the same table while specifying a third value.
It's a three column table (a, b, c) and all three make the key.
I need to select a, b, where c=1 and append them to the same table while making c=2 for each.
The actual new value for C is being passed in via a stored procedure input parameter. Can anyone help me out on this one? I could just bring the tbal into my application, loop through it and insert the new rows, but i thought that there might be a better pure SQL/DTS way to go about it.
Thanks in Advance.
It's a three column table (a, b, c) and all three make the key.
I need to select a, b, where c=1 and append them to the same table while making c=2 for each.
The actual new value for C is being passed in via a stored procedure input parameter. Can anyone help me out on this one? I could just bring the tbal into my application, loop through it and insert the new rows, but i thought that there might be a better pure SQL/DTS way to go about it.
Thanks in Advance.