Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing similar tables and rationlising information into one updated

Status
Not open for further replies.

cynaptic

Programmer
Sep 13, 2001
54
GB
Hi

I have a quandry, i Have two tables that contain more or less the same information and need to rationalise them into one table. the tables are a fairly simple list of names and addresses with some condidtional information (i.e.) yes/no fields.

The first table has the most upto date information overall but the second table has all the condidtional information.

Wat is the tried and tested procedure for running throug a table - checking it against information held in another table and appending/updating the additional information from the second table to the first?

The total number of records is close to 7000 so i don't really want to have to go through by hand and check them/update them.

I am looking for some kind of SQL procedure that will look up a record in the first table and then find the corresponding record in the second table, check for disrepencies in the first table when compared to the second table and make the correction.

Is this possible?

thanks in advance
Alex
 
Alex,

I would be interested in your solution as well. I have a similiar situation with two identical tables, one for production and the other for test environment. I am needing to compare both tables to see what is in production and not in test as well as what is in test and not in production.

Hope I am making some sence. I am new to sql and have been told to use a cursor but I have very limited knowledge on cursors.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top