<?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: Python script querying SQL database and displaying in ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022504#M59757</link>
    <description>&lt;P&gt;Great, thank you for your help!&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 13:13:55 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-02-02T13:13:55Z</dc:date>
    <item>
      <title>Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022077#M59732</link>
      <description>&lt;P class="p1"&gt;I have python code that is querying an SQL database and want to visualize this data using ArcGIS Pro. The data in the database has latitude and longitude information, I want to query the data in the database then display the points and lines between connected point. What would be the best way to do this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 13:50:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022077#M59732</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T13:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022083#M59734</link>
      <description>&lt;P&gt;This can be done, but there are a few questions about the underlying data-&amp;nbsp; Creating points can be done fairly easy, but connecting the points may be a little tricky.&amp;nbsp; How can we tell what points should be connected?&amp;nbsp; Is there anything in the data that can be filtered on to say these should be one feature and these should be another?&amp;nbsp; Are they polyogons, or polylines?&amp;nbsp; If you can, copy in your code so we can see what you have and can offer better suggestions.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 14:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022083#M59734</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T14:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022089#M59735</link>
      <description>&lt;P&gt;As&amp;nbsp;@Anonymous User&amp;nbsp;mentioned, you need the table attributes to support this operation. Check out &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/xy-to-line.htm" target="_self"&gt;XY To Line&lt;/A&gt; and notice the &lt;FONT face="courier new,courier"&gt;id_field&lt;/FONT&gt; parameter. This tool only creates single line segments so you'll need to use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/dissolve.htm" target="_self"&gt;dissolve&lt;/A&gt; to join longer segments together based on the &lt;FONT face="courier new,courier"&gt;id_field&lt;/FONT&gt; or some other field that you can include using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;attributes="ATTRIBUTES"&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 14:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022089#M59735</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-02-01T14:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022351#M59751</link>
      <description>&lt;P&gt;Thank you @Anonymous User&amp;nbsp;and &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;. To tell if the points are connected there is a table that can be queried with categories for the ID's and lat/long of the points to-from to form the line (not polygon or polyline). I understand how to display the points and lines, but am unsure of how to query the SQL database from within ArcGIS. (i.e how to call a python script through Pro/&amp;nbsp;how to connect to the SQL database in arcpy)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022351#M59751</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T22:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022355#M59752</link>
      <description>&lt;P&gt;What about &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/arcsdesqlexecute.htm" target="_self"&gt;ArcSDESQLExecute&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022355#M59752</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-02-01T22:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022361#M59753</link>
      <description>There are several ways, like creating a connection file through the database connections in arc and referencing the connection file in the script, or creating the connection string in Python and using a cursor to access the info. Which method do you prefer?&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022361#M59753</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T22:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022362#M59754</link>
      <description>&lt;P&gt;@Anonymous User, I think a connection file would be the best.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 23:16:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022362#M59754</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T23:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022370#M59755</link>
      <description>&lt;P&gt;If you haven't already, you may need to install the sql server ODBC driver. You can get them from this link, under the Install the ODBC drivers for SQl Server. &amp;nbsp; &lt;A href="https://gis.fema.gov/arcgis/help/en/server/latest/manage-data/linux/connect-sqlserver.htm" target="_self"&gt;connect-sqlserver&lt;/A&gt; and the follow the rest of the steps to create the connection.&amp;nbsp; If you get stuck on any of them, let us know and we can try to help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have the connection made, you can reference it in the code like you would other database connections.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sqlCon = r"Database Connections\yoursqlconnectionfilename"&lt;/LI-CODE&gt;&lt;P&gt;If you are using Pro, its the full path to where your connection file is in your project.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 23:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022370#M59755</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-01T23:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python script querying SQL database and displaying in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022504#M59757</link>
      <description>&lt;P&gt;Great, thank you for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 13:13:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-querying-sql-database-and-displaying/m-p/1022504#M59757</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-02T13:13:55Z</dc:date>
    </item>
  </channel>
</rss>

