Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have an ArcSDE geodatabase running on top of SQL Server 2008. A table for a feature layer was added from ArcCatalog. The SHAPE column is a type of int which was automatically converted from ArcCatalog.

My question is:

In SQL Server Management Studio, what is the best SQL syntax to output WKT for each of the records in the table?

p.s. [SHAPE].STAsText() doesn't work in

SELECT [OBJECTID] ,[SHAPE], [SHAPE].STAsText() FROM [sde].[sdl_admin].[POINT_LOCATION]

Cannot find either column "SHAPE" or the user-defined function or aggregate 
SHAPE.STAsText", or the name is ambiguous.
share|improve this question
    
I'm not on a workstation with ArcCatalog, but if your datatype on SHAPE is an int then you using SDEBINDARY for your geometry storage. If you re-import your featureclass, there will be an option to change the KEYWORD to ST_GEOMETRY. You might have to expand a section to see the drop-down list. I think if you copy/paste, the keyword is in a grid and the cell is a drop-down list. Then your SHAPE will be ST_GEOMETRY and your geometry methods will work (including your STAsText()). –  Jay Cummins Jun 8 '12 at 9:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.