geometry.STStartPoint
spatial method STStartPoint (instance.STStartPoint(...))
What changes
- Input
- spatial instance (and arguments)
- Output or change
- geometry
- Return type
- SQL Server return type: geometry CLR return type: SqlGeometry Open Geospatial Consortium (OGC) type: Point
Syntax at a glance
.STStartPoint ( )
Work example
Use geometry.STStartPoint to read the first point of a line.
Keep source point order when direction has meaning. Keep the geometry type and SRID in the review.
Check your work The first coordinate is POINT (0 0). Reversing vertex order changes it.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
-- Planar geometry. SRID 0 coordinates here are synthetic units, not metres.
DECLARE @shape geometry;
SET @shape = geometry::STGeomFromText(N'LINESTRING(0 0, 3 4)', 0);
SELECT @shape.STStartPoint().STAsText() AS line_start_point,
@shape.STSrid AS source_srid,
@shape.STIsValid() AS source_is_valid;
Open Microsoft Learn for full syntax, permissions, and details for your version.