What I have done so far is find the rows of data I need to work with, copied them into a temporary table, and removed them from the original table. Now I am trying to send the manipulated rows back to the original table. The hitch is the original table has two columns that are unique, a RecID, and a RecGUID. If I try to copy all of the columns from the temp table, I could get duplicate RecIDs and RecGUIDs. However, if I try to copy all of the columns minus the RecID and RecGUID I get an error saying that the number of columns does not match the table definition.
Here is how I created the data in #temptable:
Expand|Select|Wrap|Line Numbers
- select * into #temptable
- from originaltable
- where userID = @userID
Expand|Select|Wrap|Line Numbers
- insert into originaltable
- select column3, column4, column5, .., column48
- from #temptable;
So, my questions are these:
-How do I code the query to tell the server to generate new IDs and GUIDs for the copied rows?
-And less important, is there a better way to list all the columns except for columns 1 and 2? Thats a lot of typing. :)
Thanks for looking and for your time.
Sieldan