Select to view content in your preferred language

st_geometry function in SQL Server

7652
8
05-23-2011 12:09 PM
ErikEngstrom
Frequent Contributor
Does this exist?
When referencing st_geometry in SQL Server I'm getting an
Invalid object name 'sde.st_geometry'.


I noticed in documentation that this is SQL syntax, but is the st_geometry only an Oracle command?
Does something similar exist in SQL Server?

I have a function I'm trying to build in silverlight to take my graphics layer and publish the geometry to a feature class and the way I thought I might be able to do this is to create a stored procedure in SQL Server to insert a record into the feature class table. The only way I've found to insert the geometry into the record is to use the st_geometry function... However it doesn't seem to be working.
0 Kudos
8 Replies
KimPeter
Esri Contributor
Hi Erik,

The SQL Server spatial types are geometry and geography, and they were written by Microsoft.  You'd need to check the Microsoft documentation for information on inserting geometry to a SQL Server spatial type.

http://msdn.microsoft.com/en-us/library/bb933876.aspx

Hope this helps.

-Kim
0 Kudos
VinceAngelo
Esri Esteemed Contributor
It's not Oracle-specific.  Esri has a ST_GEOMETRY type implementation for all supported
database platforms *except* MS SQL-Server (the others support 'blade' creation).

Microsoft's GEOMETRY/GEOGRAPHY operators are case-sensitive, so be sure to match
case as you follow the documentation.

- V
0 Kudos
ErikEngstrom
Frequent Contributor
Thank you both, I will look into both the Geography and Geometry data types.
-Erik
0 Kudos
ErikEngstrom
Frequent Contributor
Looks like a data type specific to SQL Server 2008. We are currently on 2005.
I may be out of luck...
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Yes, GEOMETRY and GEOGRAPHY were introduced at SQL-Server 2008.

You can still whip up a web service to do inserts using the 'C' or Java ArcSDE APIs, but this
will not be as simple.

- V
0 Kudos
AleksanGhojoyan
Emerging Contributor
As i understand there is no way to use ST_GEOMETRY type in MS SQL Server, right? In this case, is there ability to convert, some how, records of ST_GEOMETRY from db created by SDE to SQL server geometry type. I want to use this data in MS SQL Reporting Service to show Map in report.

Another question:
There is functions like: ST_Area, ST_ExteriorRing, ST_NumInteriorRing, ST_Centroid, ST_PointOnSurface ...
Is it possible somehow use them in MS SQL SERVER ?
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Correct, there is no ST_GEOMETRY for SQL-Server.  You can use Well-Known Text as a transfer
mechanism to Microsoft's native Geometry type.  The capabilities of Geometry are documented
both online and in the SQL-Server documentation.

- V
0 Kudos
HaniuHokkaido
Deactivated User
Dear all,

I have never found the reason WHY ST_GEOMETRY IS NOT SUPPORTED in Ms SQL Server ?

Any reasons why..?

*curious*

Thanks