Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

SqlGeometry.STDistance Method

Returns the shortest distance between a point in a SqlGeometry instance and a point in the specified SqlGeometry instance.

Namespace:  Microsoft.SqlServer.Types
Assembly:  Microsoft.SqlServer.Types (in Microsoft.SqlServer.Types.dll)

[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public SqlDouble STDistance(
	SqlGeometry other
)

Parameters

other
Type: Microsoft.SqlServer.Types.SqlGeometry
The SqlGeometry instance from which to measure the distance between the instance on which STDistance is invoked. If other is an empty set, STDistance returns null.

Return Value

Type: SqlDouble
A SqlDouble value that represents the shortest distance between a point in the calling SqlGeometry and a point in the specified SqlGeometry.

STDistance always returns null if the spatial reference IDs (SRIDs) of the SqlGeometry instances do not match.

Community Additions

Show:
© 2015 Microsoft