<?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 export a feature class to .shp - unable to connect to sql server with python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098152#M62389</link>
    <description>&lt;P&gt;I am trying to upgrade a script I use in ArcMap to ArcGIS Pro. I am not able to get it to recognize the the path to our sql server which houses the feature class I want to access. The script work fine in ArcGIS Map but I get errors when trying in ArcGIS Pro.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobNoyes_0-1631638672001.png" style="width: 764px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22954i3C9BD5D1D72453BC/image-dimensions/764x90?v=v2" width="764" height="90" role="button" title="BobNoyes_0-1631638672001.png" alt="BobNoyes_0-1631638672001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is a script that will have multiple lines but the first step is creating problems. Also, I ran the export tool on the feature class in pro and it worked fine. I then copied the snippet from the results and pasted it into the script (using PyCharm).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is the script as it stands so far:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;    in_table = &lt;SPAN&gt;r'Database Connections\GIS Update.sde\GIS_update.dbo.Orion_Taxlots\GIS_update.dbo.Orion_Taxlots'&lt;BR /&gt;&lt;/SPAN&gt;    in_data = &lt;SPAN&gt;r'Database Connections\JOCO B Marial.sde\jocoB_Production.DBO.POLY\jocoB_Production.DBO.poly_gon'&lt;BR /&gt;&lt;/SPAN&gt;    out_path = &lt;SPAN&gt;r"C:\GIS\Substage"&lt;BR /&gt;&lt;/SPAN&gt;    out_shp = &lt;SPAN&gt;"jocoB_Production_DBO_poly_gon.shp"&lt;BR /&gt;&lt;/SPAN&gt;    TL = &lt;SPAN&gt;r"C:\GIS\Substage\jocoB_Production_DBO_poly_gon.shp"&lt;BR /&gt;&lt;/SPAN&gt;    Out_Taxlots = &lt;SPAN&gt;"C:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;GIS&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Substage&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Taxlots.shp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;# Step 1 jocoB poly_gon copied to C:\GIS\Substage&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.FeatureClassToShapefile_conversion(in_data&lt;SPAN&gt;, &lt;/SPAN&gt;out_path)&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Step 1 complete"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# Step 2   Dissolve TL.shp on MNX as Taxlots.shp&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.Dissolve_management(&lt;SPAN&gt;in_features&lt;/SPAN&gt;=TL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;out_feature_class&lt;/SPAN&gt;=Out_Taxlots&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;dissolve_field&lt;/SPAN&gt;=&lt;SPAN&gt;"MNX"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;statistics_fields&lt;/SPAN&gt;=&lt;SPAN&gt;"#"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;multi_part&lt;/SPAN&gt;=&lt;SPAN&gt;"MULTI_PART"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;unsplit_lines&lt;/SPAN&gt;=&lt;SPAN&gt;"DISSOLVE_LINES"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Step 2 complete: dissolved TL.shp on MNX, save as Taxlots.shp"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;Exception &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Error: " &lt;/SPAN&gt;+ e.args[&lt;SPAN&gt;0&lt;/SPAN&gt;])&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Sep 2021 17:11:30 GMT</pubDate>
    <dc:creator>BobNoyes</dc:creator>
    <dc:date>2021-09-14T17:11:30Z</dc:date>
    <item>
      <title>export a feature class to .shp - unable to connect to sql server with python</title>
      <link>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098152#M62389</link>
      <description>&lt;P&gt;I am trying to upgrade a script I use in ArcMap to ArcGIS Pro. I am not able to get it to recognize the the path to our sql server which houses the feature class I want to access. The script work fine in ArcGIS Map but I get errors when trying in ArcGIS Pro.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobNoyes_0-1631638672001.png" style="width: 764px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22954i3C9BD5D1D72453BC/image-dimensions/764x90?v=v2" width="764" height="90" role="button" title="BobNoyes_0-1631638672001.png" alt="BobNoyes_0-1631638672001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is a script that will have multiple lines but the first step is creating problems. Also, I ran the export tool on the feature class in pro and it worked fine. I then copied the snippet from the results and pasted it into the script (using PyCharm).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is the script as it stands so far:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;    in_table = &lt;SPAN&gt;r'Database Connections\GIS Update.sde\GIS_update.dbo.Orion_Taxlots\GIS_update.dbo.Orion_Taxlots'&lt;BR /&gt;&lt;/SPAN&gt;    in_data = &lt;SPAN&gt;r'Database Connections\JOCO B Marial.sde\jocoB_Production.DBO.POLY\jocoB_Production.DBO.poly_gon'&lt;BR /&gt;&lt;/SPAN&gt;    out_path = &lt;SPAN&gt;r"C:\GIS\Substage"&lt;BR /&gt;&lt;/SPAN&gt;    out_shp = &lt;SPAN&gt;"jocoB_Production_DBO_poly_gon.shp"&lt;BR /&gt;&lt;/SPAN&gt;    TL = &lt;SPAN&gt;r"C:\GIS\Substage\jocoB_Production_DBO_poly_gon.shp"&lt;BR /&gt;&lt;/SPAN&gt;    Out_Taxlots = &lt;SPAN&gt;"C:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;GIS&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Substage&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Taxlots.shp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;# Step 1 jocoB poly_gon copied to C:\GIS\Substage&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.FeatureClassToShapefile_conversion(in_data&lt;SPAN&gt;, &lt;/SPAN&gt;out_path)&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Step 1 complete"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;# Step 2   Dissolve TL.shp on MNX as Taxlots.shp&lt;BR /&gt;&lt;/SPAN&gt;    arcpy.Dissolve_management(&lt;SPAN&gt;in_features&lt;/SPAN&gt;=TL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;out_feature_class&lt;/SPAN&gt;=Out_Taxlots&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;dissolve_field&lt;/SPAN&gt;=&lt;SPAN&gt;"MNX"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;statistics_fields&lt;/SPAN&gt;=&lt;SPAN&gt;"#"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;multi_part&lt;/SPAN&gt;=&lt;SPAN&gt;"MULTI_PART"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;unsplit_lines&lt;/SPAN&gt;=&lt;SPAN&gt;"DISSOLVE_LINES"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Step 2 complete: dissolved TL.shp on MNX, save as Taxlots.shp"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;Exception &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Error: " &lt;/SPAN&gt;+ e.args[&lt;SPAN&gt;0&lt;/SPAN&gt;])&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098152#M62389</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2021-09-14T17:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: export a feature class to .shp - unable to connect to sql server with python</title>
      <link>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098158#M62390</link>
      <description>&lt;P&gt;I would make sure you are using the correct connection for Pro (In Oracle ats least you needed to use a 64-bit client instead of a 32-bit client).&lt;/P&gt;&lt;P&gt;I would use the actual path to the database connection c:\... instead of shorthand path which definitely works in ArcMap but I do not thinks works with Pro due to its different architecture.&lt;/P&gt;&lt;PRE&gt;in_table = &lt;SPAN&gt;r'Database Connections\GIS Update.sde\GIS_update.dbo.Orion_Taxlots\GIS_update.dbo.Orion_Taxlots'&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098158#M62390</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-09-14T17:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: export a feature class to .shp - unable to connect to sql server with python</title>
      <link>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098162#M62392</link>
      <description>&lt;P&gt;Thanks. We are using Microsoft sql server and its at 64 bit. I am not sure what you mean when you say the actual path and use the C:\ drive prompt. This is not something I have ran across before. In the past it was as easy as copying and pasting the path from ArcCatalog..... Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-a-feature-class-to-shp-unable-to-connect-to/m-p/1098162#M62392</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2021-09-14T17:30:01Z</dc:date>
    </item>
  </channel>
</rss>

