<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Compare the feature count between features in SDE in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349924#M27433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help with the follow Python Script would be great!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to compare the feature count between features in production SDE and development SDE. So far I have got the following attached, which works but I have the loop in the wrong place, so the comparison at the end compares all DEV features against the first PROD features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 13:29:07 GMT</pubDate>
    <dc:creator>NishiChauhan-Patel</dc:creator>
    <dc:date>2012-05-24T13:29:07Z</dc:date>
    <item>
      <title>Compare the feature count between features in SDE</title>
      <link>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349924#M27433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help with the follow Python Script would be great!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to compare the feature count between features in production SDE and development SDE. So far I have got the following attached, which works but I have the loop in the wrong place, so the comparison at the end compares all DEV features against the first PROD features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 13:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349924#M27433</guid>
      <dc:creator>NishiChauhan-Patel</dc:creator>
      <dc:date>2012-05-24T13:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare the feature count between features in SDE</title>
      <link>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349925#M27434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have run this exact procedure before. Except it was between two FGDB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully it translates for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os

sde1 = r"D:\sde_transit\sde1.gdb"
output = r"D:\sde_transit\sdeCSRS.gdb"

arcpy.env.workspace = sde1
sdeList = arcpy.ListFeatureClasses()

for fc in sdeList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.GetCount_management(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; count1 = result.getOutput(0)

&amp;nbsp;&amp;nbsp;&amp;nbsp; fc2 = os.path.join(output,fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(fc2):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.GetCount_management(fc2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count2 = result.getOutput(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if count1 == count2:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc+" OK"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Problem with "+fc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print count1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print count2
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc2+" not found"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

# Clean up
sdeList = None
del arcpy.env.workspace
del arcpy&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349925#M27434</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T16:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Compare the feature count between features in SDE</title>
      <link>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349926#M27435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much, worked really well, just needed to adapt it a little!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 07:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/compare-the-feature-count-between-features-in-sde/m-p/349926#M27435</guid>
      <dc:creator>NishiChauhan-Patel</dc:creator>
      <dc:date>2012-05-25T07:15:24Z</dc:date>
    </item>
  </channel>
</rss>

