<?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 Re: How to call an SQL Server stored procedure from ArcMAP  in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460804#M17838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you linked to the documentation of a retired release of ArcGIS?&amp;nbsp; Current documentation also references &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/arcsdesqlexecute.htm"&gt;arcpy.ArcSDESQLExecute&lt;/A&gt;, which remains the only within-ArcPy method to execute &lt;EM&gt;ad-hoc&lt;/EM&gt; SQL. Note that this function could be used to corrupt geodatabase metadata (with an injudicious DROP TABLE, for example), so extreme care should be used.&amp;nbsp; That said, I just executed a cascade of 1200+ SQL statements against a PostgreSQL database (thanks to Python dictionaries, string substitution, and nested looping), so the only reason to fall back to ODBC is if your return results are not supported by the API (the most dangerous being long (64-bit) integers and geometry columns).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Feb 2018 16:46:18 GMT</pubDate>
    <dc:creator>VinceAngelo</dc:creator>
    <dc:date>2018-02-21T16:46:18Z</dc:date>
    <item>
      <title>How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460803#M17837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I wounder if there is a method to call SQL Stored Procedures from the ArcMAP?&lt;/P&gt;&lt;P&gt;I&amp;nbsp;can use python&amp;nbsp; &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000021000000.htm"&gt;"&lt;/A&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000021000000.htm"&gt;execute(sql_statement)"&lt;/A&gt; to do this but I am looking for other methods if there is ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Ahmad&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 15:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460803#M17837</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2018-02-21T15:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460804#M17838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you linked to the documentation of a retired release of ArcGIS?&amp;nbsp; Current documentation also references &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/arcsdesqlexecute.htm"&gt;arcpy.ArcSDESQLExecute&lt;/A&gt;, which remains the only within-ArcPy method to execute &lt;EM&gt;ad-hoc&lt;/EM&gt; SQL. Note that this function could be used to corrupt geodatabase metadata (with an injudicious DROP TABLE, for example), so extreme care should be used.&amp;nbsp; That said, I just executed a cascade of 1200+ SQL statements against a PostgreSQL database (thanks to Python dictionaries, string substitution, and nested looping), so the only reason to fall back to ODBC is if your return results are not supported by the API (the most dangerous being long (64-bit) integers and geometry columns).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:46:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460804#M17838</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2018-02-21T16:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460805#M17839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe there is a way within ArcGIS to do this. However, this is a good thing, as Vince noted, could be extremely dangerous.&amp;nbsp; So if you want to do this, you will have to resort to programming.&amp;nbsp; If you are doing this via programming, be ABSOLUTELY sure you know what you are doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My personal use in using stored procedures 99% of the time is only in a read only context to extract data to make outside joins upon.&amp;nbsp; The other 1% is strictly for updating non geometric attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you looked at defining a "View".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 17:25:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460805#M17839</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2018-02-21T17:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460806#M17840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Thanks&amp;nbsp;&lt;A _jive_internal="true" class="" data-containerid="-1" data-containertype="-1" data-objectid="3051" data-objecttype="3" href="https://community.esri.com/people/vangelo-esristaff" style="color: #287433; background-color: transparent; border: 0px; font-weight: inherit; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;Vince Angelo&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A _jive_internal="true" class="" data-containerid="-1" data-containertype="-1" data-objectid="5768" data-objecttype="3" href="https://community.esri.com/people/tkowal" style="color: #287433; background-color: transparent; border: 0px; font-weight: inherit; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;Ted Kowal&lt;/A&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;Actually there is no&amp;nbsp; a reason&amp;nbsp;for linking&amp;nbsp; documentation of a retired release of ArcGIS. I was trying to define some&amp;nbsp;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;Stored Procedures&amp;nbsp; in the SQL server and let the users&amp;nbsp;call them from the Arcmap (mainly from the Query builder window)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;, instead of writing&amp;nbsp;very long query's ( 10 lines ) the user can pass the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Procedure name&lt;/SPAN&gt;&amp;nbsp;- I believe this will reduce the errors&amp;nbsp; and the traffic over the network.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;Ted, I am using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;stored procedures&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;for read only purposes,&amp;nbsp;in my case&amp;nbsp;&amp;nbsp;I prefer&amp;nbsp;SP than the normal database views since&amp;nbsp; they are more flexible&amp;nbsp;than the views&amp;nbsp; ( the User can pass a parameter when he calls the SP).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;So my only solution right now it to write python tool that can call these procedures to Arcmap!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;Thanks for your help,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;Ahmad&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2018 20:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460806#M17840</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2018-02-26T20:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460807#M17841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normal views can be accessed as Query Layers; stored procedures cannot.&lt;/P&gt;&lt;P&gt;Packets being what they are, I doubt you'd see a measurable difference in network traffic, even if the query only returns one row.&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2018 21:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460807#M17841</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2018-02-26T21:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460808#M17842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am a big believer in use of stored procedures for their full capabilities,&amp;nbsp;especially since the spatial columns in most common DBMS's have a SQL API to go with them (several are Esri ST_Geometry or Esri/DBMS Vendor implementations).&amp;nbsp; You can white holistic PL/SQL on spatial and non-spatial data tables (minding, of course,&amp;nbsp;the documentation of the specific conditions under which SQL based programming is safe and supported).&amp;nbsp; See links below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very important regarding Stored Procedure development:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #ff0000;"&gt;Should be done only after fully reviewing and understanding Esri's documentation on SQL access to the database.&lt;/SPAN&gt;&amp;nbsp; Start here:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/sql-and-enterprise-geodatabases.htm" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/sql-and-enterprise-geodatabases.htm"&gt;SQL and enterprise geodatabases—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(Also look in Esri's Proceedings for "SQL".&amp;nbsp; Watch for 2018 International and DC Developer Summit Proceedings, coming soon)&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="http://proceedings.esri.com/library/userconf/index.html" title="http://proceedings.esri.com/library/userconf/index.html"&gt;Recent Proceedings&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #ff0000;"&gt;Should be done by a highly experienced Esri geodatabase and DBMS developer&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 18:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460808#M17842</guid>
      <dc:creator>DaleBrooks</dc:creator>
      <dc:date>2018-04-06T18:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to call an SQL Server stored procedure from ArcMAP</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460809#M17843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe &lt;A href="https://community.esri.com/migrated-users/3051"&gt;Vince Angelo&lt;/A&gt;&amp;nbsp;answered this completely and&amp;nbsp;&lt;A href="https://community.esri.com/people/Dale_Brooks-esristaff"&gt;Dale_Brooks-esristaff&lt;/A&gt;&amp;nbsp;gave an excellent word warning!&amp;nbsp; &amp;nbsp;Currently, I am using coding to access Stored Procedures, my case it is VB.Net wrapped up around various custom commands that I have created to work within ArcMap.&amp;nbsp; These, by nature, are very specific to your individual working environment.&amp;nbsp; Since I am not fully versed in the geometry stuff, I do not touch any esri specific fields but only use store procedures with the attributes... for example, in my shop we use LRS (Linear Referencing System). Most of our new roads are being constructed at the beginnings of the route&amp;nbsp; thereby constantly changing the beginning mile point.&amp;nbsp; So store procedures in my case allow me to trigger an event that changes all the assets that are collected in reference to Mileposts downstream of the change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2018 14:51:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-call-an-sql-server-stored-procedure-from/m-p/460809#M17843</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2018-04-09T14:51:56Z</dc:date>
    </item>
  </channel>
</rss>

