<?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 perform a spatial select against a Sql Server query layer (keeps crashing) in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258222#M8852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I installed WireShark but it is well outside my area of expertise. I'm guessing I need to set up a capture filter and then try to run the sql in ArcMap, but that's as far as I got.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try some importing/exporting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Aug 2019 06:11:33 GMT</pubDate>
    <dc:creator>EvanD</dc:creator>
    <dc:date>2019-08-19T06:11:33Z</dc:date>
    <item>
      <title>How to perform a spatial select against a Sql Server query layer (keeps crashing)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258220#M8850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble with ArcMap 10.4.1 hanging when performing select by location. I have point data stored in a sql server database table (&lt;EM&gt;Bores&lt;/EM&gt;)&amp;nbsp;with a geometry field, &lt;EM&gt;GeogLoc&lt;/EM&gt;. I can do a select by location from a query layer based on the &lt;EM&gt;Bores&lt;/EM&gt; table to get points within a polygon in a layer, &lt;EM&gt;Basin100&lt;/EM&gt;, from a geodatabase.&amp;nbsp;However, when I join the &lt;EM&gt;Bores&lt;/EM&gt;&amp;nbsp;table to my sql server&amp;nbsp;&lt;EM&gt;WaterLevel&lt;/EM&gt; table with a one-to-many PK to FK relationship,&amp;nbsp;and then try to select the locations, ArcMap hangs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;a clustered index on the PK, &lt;EM&gt;BoreID&lt;/EM&gt; in the &lt;EM&gt;Bores&lt;/EM&gt; table and a non-clustered index of the&amp;nbsp;FK in the &lt;EM&gt;WaterLevel&lt;/EM&gt; table. I have tried a spatial index on the &lt;EM&gt;GeogLoc&lt;/EM&gt; field in the &lt;EM&gt;Bores&lt;/EM&gt; table. I have tried both creating the join in the sql for the query layer and by creating a view in sql server. I tried indexing the view to make it a materialized view. None of that helps. It appears everything on the sql server side works properly and quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried modifying the sql for the query layer so that fewer than 10 bore locations are returned and then the select by location is successful, but very slow. If I increase it to ~100 locations (&amp;lt; ~1000 records), the operation hangs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any advice on why this is not working and possible solutions or work-arounds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2019 03:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258220#M8850</guid>
      <dc:creator>EvanD</dc:creator>
      <dc:date>2019-08-16T03:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform a spatial select against a Sql Server query layer (keeps crashing)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258221#M8851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to run software such as WireShark to audit the calls being made to the SQL Server database from ArcMap?&amp;nbsp; In my experience with query layers some of the calls are being incorrectly created by ArcMap when being sent to the database (e.g. where clause being dropped so all records are being retrieved when in reality only a subset should be retrieved).&amp;nbsp; Might not be happening to you, but WireShark is useful to trace this specific type of activity when troubleshooting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also try exporting data from the SQL Server database to a file geodatabase to create ESRI recognized spatial feature classes and see if the same problem occurs.&amp;nbsp; You could also export the data to an SDE SQL Server database to see if you get better results with standard GIS layers and not query layers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2019 10:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258221#M8851</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-08-16T10:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform a spatial select against a Sql Server query layer (keeps crashing)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258222#M8852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I installed WireShark but it is well outside my area of expertise. I'm guessing I need to set up a capture filter and then try to run the sql in ArcMap, but that's as far as I got.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try some importing/exporting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 06:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-perform-a-spatial-select-against-a-sql/m-p/258222#M8852</guid>
      <dc:creator>EvanD</dc:creator>
      <dc:date>2019-08-19T06:11:33Z</dc:date>
    </item>
  </channel>
</rss>

