Sunday, July 29, 2012

Find Duplicate Attributes in an ESRI Geodatabase

I snapped this idea from ideas.arcgis.com,
I have been looking for a GP tool that can be used to find and list duplicate attribute values in an attribute table since ArcGIS 9.3.  I was able to find a SQL script for this purpose in the GDB Management Island at the 2012 UC, but I would have to Remote Desktop into another machine to run this process.  
If the duplicate ID values can be found and listed using a GP tool, that would be helpful in my organization's workflow process. 

Until ESRI implements this, here is a quick script (download here) I wrote for you guys to do just that.


  • Open ArcMap
  • Go to customize
  • Go to Commands 
  • Scroll until UI Controls
  • Click NeW UIControl and select button
  • Drag the new button anywhere in the toolbars
  • Right click on the new button and click view source (make sure you are still in customize mode)
  • Paste the code and run,
  • you must first select the layer you want to find the duplicates in and then click the button, there you will be prompted to type-in the field name..














4 comments:

  1. Gosh, your code rocks, whether related to simple tools or complex ones .. always surprise us dude!

    ReplyDelete
  2. Would it be possible to write a variant of this script that compares multiple field names & the GIS coordinates?

    ReplyDelete
  3. The script works great. But at the very end of processing, after it pops up the results window and opens results in notepad... ArcMap(10.1 sp1) stops working and must be closed. Any clues to why this may be?

    Thanks for writing and distributing your code.

    ReplyDelete

Share your thoughts