June 2, 2010 at 2:42 pm
Eugene Elutin (6/2/2010)
biren (6/2/2010)
Eugene Elutin (6/2/2010)
Basically, my sample does exactly the same:It copies some records from Table_B to Table_A (condition is in WHERE clause) and at the same time it deletes these copied records from Table_B.
However strictly speaking: It does delete records from Table_B and does insert these deleted records into Table_A.
I hornestly believe that you should be able to apply the above method in your case.
can you please be more specific in that part select union " " I still dont understand what I have to do in it..
biren, you don't need to do it at all as, I believe, you already have real data in your real tables. I have used it to populate tables with some data for a sample I've gave you and to demonstrate what should be provided together with a questions you ask on this forum. Setup of tables and sample data minimizes time the helper need to spend on your problem. Some experts here are quite busy with their own work, so they will not even look in your problem if you not providing setup!
So, when you execute my sample code, you can realise what will happen and how data will be moved from Table_B to Table_A. To look it in more details, execute sample query by query checking what table looks like after each.
Based on the sample, you should be able to write similar query for your real tables.
You haven't answered the questino regarding the ID values from you IDENTITY column? Should they be regenerated when records are moved from your Order_B table (based on the current next availbale identity value in table Order_A) or they should stay as they were in Order_B?
in other table I am transferring does not has identity column so, I need not to worry just transfer the data and the identity column value will remain same as the other..........
THANKS SO MUCH THIS HELPED !!
Viewing post 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply