<?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: Create sde feature class from SQL Server table with ArcPy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1161414#M64285</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to reference a database connection file rather than the IP address:&amp;nbsp;&lt;A href="https://enterprise.arcgis.com/en/server/latest/manage-data/windows/connect-sqlserver.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/server/latest/manage-data/windows/connect-sqlserver.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 22:46:45 GMT</pubDate>
    <dc:creator>Marc_Graham</dc:creator>
    <dc:date>2022-04-05T22:46:45Z</dc:date>
    <item>
      <title>Create sde feature class from SQL Server table with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1161405#M64284</link>
      <description>&lt;P&gt;I am trying to take data from a table in SQL Server and create a feature class in an enterprise geodatabase. I'm having issues *I think* with trying to reference a SQL Server table in tools that are expecting a filepath to a table.&lt;/P&gt;&lt;P&gt;I have tried using "MakeXYEventLayer", "MakeQueryLayer", "XYTabletoPoint" and I keep getting errors.&lt;/P&gt;&lt;P&gt;After some reading I think part of the issue is that these tools are looking for a table but I may still need to put a query on the SQL table to get the right results. I'm pretty new to SQL Server tables so I'm not sure.&lt;/P&gt;&lt;P&gt;I think the steps should be:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a table view from the SQL Server table.&lt;/LI&gt;&lt;LI&gt;Use that table view in XYTabletoPoint.&lt;OL&gt;&lt;LI&gt;^if possible, this seems the most straightforward. If not I could use one of the other tools I mentioned and then use feature class to feature class&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Convert the output of XYTabletoPoint to be a feature class in the sde I already have.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is this correct? Can I see an example of how the parameters would be formatted? Example of how I've tried it below:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;IP address of the server - xxx.xxx.x.xxx&lt;/LI&gt;&lt;LI&gt;Database name - yyyy&lt;/LI&gt;&lt;LI&gt;Table name - zzz&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For input table/input parameters I've tried:&amp;nbsp; xxx.xxx.x.xxx\yyyy\zzzz and xxx.xxx.x.xxx.yyyy.zzzz; setting the IP address/database as the environment workspace then just zzzz; and setting just the IP address as the environment workspace then just yyyy.zzzz and yyyy\zzzz&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 22:15:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1161405#M64284</guid>
      <dc:creator>CaraWiebalk</dc:creator>
      <dc:date>2022-04-05T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create sde feature class from SQL Server table with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1161414#M64285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to reference a database connection file rather than the IP address:&amp;nbsp;&lt;A href="https://enterprise.arcgis.com/en/server/latest/manage-data/windows/connect-sqlserver.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/server/latest/manage-data/windows/connect-sqlserver.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 22:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1161414#M64285</guid>
      <dc:creator>Marc_Graham</dc:creator>
      <dc:date>2022-04-05T22:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create sde feature class from SQL Server table with ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1162719#M64312</link>
      <description>&lt;P&gt;Thank you! I didn't get a notification about this and only just saw this now. I had figured out a workaround but this is useful for the future.&lt;BR /&gt;&lt;BR /&gt;I ended up following the steps listed here (&lt;A href="https://datatofish.com/export-sql-table-to-csv-python/" target="_blank"&gt;https://datatofish.com/export-sql-table-to-csv-python/&lt;/A&gt;) and used pyodbc and pandas functions to export the SQL server table into a csv which I could then use with arcpy functions.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 20:07:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-sde-feature-class-from-sql-server-table/m-p/1162719#M64312</guid>
      <dc:creator>CaraWiebalk</dc:creator>
      <dc:date>2022-04-08T20:07:41Z</dc:date>
    </item>
  </channel>
</rss>

