Copy Records between Tables

6996
8
11-30-2012 08:20 AM
JayKappy
Frequent Contributor
I have a FILE geodatabase with Tables in it.  I want to copy records from one to the other and then delete from the original.
I can select and copy the records in the first table but cant figure out how to copy them into the 2nd table.
Thoughts?

THanks
8 Replies
T__WayneWhitley
Honored Contributor
Have you tried Copy Rows?  You can Make Table View with a query 1st if you need a subset of records copied.

Append will copy gdb table or fc records to an existing table.  Then, of course, there is a Delete tool as well, to get rid of unwanted tables, etc.
0 Kudos
JayKappy
Frequent Contributor
Yea I have to grab a few of the records from the first table.  If I select them in the table what do I do next?  Where do you see Copy Rows?
0 Kudos
JayKappy
Frequent Contributor
I see the Copy rows in the toolbox....but how do I build the query first to grab a selected number of records from a field value. and then how do I append them to another table?
0 Kudos
JayKappy
Frequent Contributor
Are you saying to copy the rows of the entire table,
Delete the ones I dont want
Append the result to existing table?
0 Kudos
T__WayneWhitley
Honored Contributor
So, let me back up just a sec so I can visualize what you are doing - you are operating in ArcMap, and you have 2 tables in ArcMap and you have selected records in one of them to 'paste' into the other?

This is probably not the only way, but since you cannot execute a 'copy' as with a feature class, pasting them into a target fc, you have the option to open your system toolboxes (there is a ArcCatalog shortcut or use the Toolbox window) and use the Append tool (since your target is an existing table).

However before you do this, let's see if Copy Rows behaves as I expect, copying only the selected rows to a new gdb table.  If it doesn't copy only the selection then execute a Make Table View before Copy Rows to determine if only the selection is honored.

If this works properly, then do the same for Append processing....in other words, preprocess with Make Table View 1st if necessary.  I only suggested experimenting with Copy Rows because it's easier to delete an extra table than it is to find and remove extra rows in an existing table.
0 Kudos
T__WayneWhitley
Honored Contributor
OK, just to clear things up you may copy selected records from 1 table to another using Append.
It honors a selected subset.  (Use Copy Rows if you want a new table.)


Append (Data Management)
Desktop » Geoprocessing » Tool reference » Data Management toolbox
http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000050000000


Additional info - let's just say you're operating outside ArcMap so you do not have a selection defined (or you already have a SQL query with which to make your selection), then you can use Make Table View to do that with the SQL query before running the Append process.

Make Table View (Data Management)
Desktop » Geoprocessing » Tool reference » Data Management toolbox
http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000006v000000
0 Kudos
JayKappy
Frequent Contributor
Thanks for your thoughts..
I tried to select the rows in the first and do an append....it sort of worked...wierd things happening...the records were appended from tbl1 to tbl2 , but at the same time the records from tbl2 were appened to tbl1....

I copied the tbl1 in gdb
removed the records i did not want.
did an append to tbl2
and that seemed to do the trick....

not pretty but it worked....Thanks and have a great weekend
0 Kudos
ModernElectric
Frequent Contributor
I had a similar issue with copying fields from a table to a feature class and wondering if what I came up with will work for you. What I did is to take a table (lets call it TB1) and a feature class (call it FC1) and use the join feature. This will work out if you have a linking field with a 1:1 relationship. That way you make sure everything from the field from TB1 is copied to the field of you choice to FC1. Once I joined TB1 to FC1 - I opened to the attributes table in ArcMap and selected the "Calculate Field" feature which allowed me to copy the field from TB1 and put it into the field of FC1 that I selected. It looks like you should be able to do the same thing with a Table to Table Join and use the Calculate Field feature. HOWEVER - in order to make sure you get everything to go from the field in TB1 to a field in TB2 - there has to be a 1:1 relationship. Hope this helps.
0 Kudos