<?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: Creating a spatial table in Enterprise database and write data in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/creating-a-spatial-table-in-enterprise-database/m-p/1385537#M44982</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7067"&gt;@TomGeo&lt;/a&gt;&amp;nbsp;-&amp;nbsp; &amp;nbsp;see the SQL Server Documentation about the Geometry Spatial Data Type&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql?view=sql-server-ver16" target="_blank"&gt;geometry (Transact-SQL) - SQL Server | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SQL Server Geodatabases use the SQL Server Native Geometry and Geography Spatial Data Types, there is no esri st_geometry spatial type for SQL Server.&lt;BR /&gt;&lt;BR /&gt;If the SQL Server Database has an ArcSDE Geodatabase Repository, then you can create the table using ArcMap or ArcGIS Pro instead of trying to manually create the table via SQL, this can also help you to determine the proper syntax to create the table and to insert data, but the SQL Server Documentation will have more examples and details.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 16:46:22 GMT</pubDate>
    <dc:creator>MarceloMarques</dc:creator>
    <dc:date>2024-02-22T16:46:22Z</dc:date>
    <item>
      <title>Creating a spatial table in Enterprise database and write data</title>
      <link>https://community.esri.com/t5/data-management-questions/creating-a-spatial-table-in-enterprise-database/m-p/1385344#M44981</link>
      <description>&lt;P&gt;I have an Enterprise database and want to write data into it. In case the table I am addressing does not exists I would need to create the table. Creating the table seems to give me some challenge with respect to the required data type for the geometry column.&lt;/P&gt;&lt;P&gt;When I look into other Enterprise database tables the geometry column is initiated by&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SHAPE geometry NULL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and using the geometry type let's me at least create the table.&lt;BR /&gt;However, looking for the right procedure I came across this &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/workflow-creating-a-table-with-sql-and-registering-it-with-the-geodatabase.htm#GUID-5B16945B-956C-4C95-8777-652AB7E92038" target="_blank" rel="noopener"&gt;workflow&lt;/A&gt;, where there are several versions of how to create a spatial table in an Enterprise database, but SQL Server is not in there. But I was wondering if the geometry type is the right one.&lt;/P&gt;&lt;P&gt;Once the table is created, I went to register the table with the geodatabase in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;Back in SQL my next statement is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;INSERT INTO Buildings (SHAPE) 
VALUES 
(geometry::STGeomFromText('POLYGON Z ((695023.53 6181945.6 25.55,695014.58 6181947.59 
25.7,695014.32 6181946.41 25.7,695010.94 6181947.17 25.4,695009.57 6181941.03 25.4,
695013.02 6181940.26 25.55,695010.59 6181929.37 25.55,695019.48 6181927.39 25.55,
695023.53 6181945.6 25.55))', 25832);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this one gives me the following error&lt;/P&gt;&lt;P&gt;Query failed, possibly due to a malformed statement. Query Text `INSERT&lt;BR /&gt;INTO&lt;BR /&gt;Buildings (SHAPE)&lt;BR /&gt;VALUES (geometry::STGeomFromText('POLYGON Z ((695023.53 6181945.6 25.55,695014.58 6181947.59 25.7,695014.32 6181946.41 25.7,695010.94 6181947.17 25.4,695009.57 6181941.03 25.4,695013.02 6181940.26 25.55,695010.59 6181929.37 25.55,695019.48 6181927.39 25.55,695023.53 6181945.6 25.55))',&lt;BR /&gt;25832)'. Provider error `(-2147217900) Incorrect syntax near ')'.'&lt;/P&gt;&lt;P&gt;Does somebody can point me at the mistake I am making?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 10:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/creating-a-spatial-table-in-enterprise-database/m-p/1385344#M44981</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2024-02-22T10:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a spatial table in Enterprise database and write data</title>
      <link>https://community.esri.com/t5/data-management-questions/creating-a-spatial-table-in-enterprise-database/m-p/1385537#M44982</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7067"&gt;@TomGeo&lt;/a&gt;&amp;nbsp;-&amp;nbsp; &amp;nbsp;see the SQL Server Documentation about the Geometry Spatial Data Type&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql?view=sql-server-ver16" target="_blank"&gt;geometry (Transact-SQL) - SQL Server | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;SQL Server Geodatabases use the SQL Server Native Geometry and Geography Spatial Data Types, there is no esri st_geometry spatial type for SQL Server.&lt;BR /&gt;&lt;BR /&gt;If the SQL Server Database has an ArcSDE Geodatabase Repository, then you can create the table using ArcMap or ArcGIS Pro instead of trying to manually create the table via SQL, this can also help you to determine the proper syntax to create the table and to insert data, but the SQL Server Documentation will have more examples and details.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:46:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/creating-a-spatial-table-in-enterprise-database/m-p/1385537#M44982</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-02-22T16:46:22Z</dc:date>
    </item>
  </channel>
</rss>

