0

I need to compare the data in two identical tables in different copies of a geodatabase and select the rows in Table 1 that aren't included Table 2 so that they can be added on to Table 2 (part of the locally stored, main copy of the geodatabase). I will have to do this task regularly, so I would like to automate it as part of a model (I've already built a model to do this task for the shapefiles in the geodatabase).

So far I've tried Add Join and Compare Table but it doesn't look like either will do what I need.

What are other ways to accomplish this task?

  • What sorts of changes occur? New rows added, and/or values updated? If new rows are added, are they always added at the end of the table? Are rows deleted as well? Does order change? – Emil Brundage Nov 5 '15 at 23:20
  • What about the Compare Table or Add Join tools don't work for you? I can see these as the first step in a process which identifies features to add to Table 2. – Fezter Nov 5 '15 at 23:50
  • 1
    "Best" might get this closed as too broad/opinion based. One approach you might investigate is using nested queries. This requires both tables to be in the same geodatabase though. See my answers at gis.stackexchange.com/questions/103189 and gis.stackexchange.com/questions/110179 related to the concept. Basically once you have both tables in the same geodatabase, you can then use SQL to select all the records not in the other table (or all that are and then invert the selection). Another approach, merge all records and then use Find/Delete identical. – Chris W Nov 5 '15 at 23:53
  • Emil- Table 1 has new rows, pretty much always at the end of the table. Table 2 will have had some processing done, mainly calculating values for certain fields and a check on the data to make sure nothing is amiss. – D Stone Nov 17 '15 at 20:00
  • Fezter- Compare table doesn't give me a selection of records, it just creates a new table and the Add Join tool never contains all the records I need. – D Stone Nov 17 '15 at 20:06
1

Possible workflow:

  1. Import Update table to Main geodatabase.
  2. Using nested query, select all records in Update that are present in Main (Select Update Where "pointid" IN (SELECT "pointid" FROM Main_Table)
  3. Delete selected records as duplicates.
  4. Append remaining Update records to Main.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.