Select to view content in your preferred language

How to display line length in SDE View SQL Server

3130
4
02-15-2018 12:14 PM
JoseSanchez
Regular Contributor

Hello everyone,

The field "SHAPE.STLength()" does not show in the feature class when I try to create a view.  Is there any function that allows to calculate in a SQL statement the length of a line form the field SHAPE?

Thanks

0 Kudos
4 Replies
JoseSanchez
Regular Contributor

Found it:

SELECT [FeatureID], [SHAPE] AS Geometry, SHAPE.STLength() AS Length FROM [database].[owner].[WaterLine]

This shows how to display in a SQL Query or a SQL SDE view the length of a line.

JoseSanchez
Regular Contributor

This SQL statement displays X and Y coordinates

SELECT  [PumpNumber], [SHAPE], SHAPE.STX, SHAPE.STY  FROM [PUMP]