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


Cannot find either column "SHAPE" or the user-defined function or aggregate 
SHAPE.STAsText", or the name is ambiguous.
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.