AnsweredAssumed Answered

SQL Error Shape.STContains is not allowed

Question asked by newfinla on Sep 15, 2016
Latest reply on Mar 19, 2017 by Martin_Rowe

I am trying to create a SQL view to count the number of point features in a polygon.  The following code works when run in a SQL Query, however when I try to create a view using the code I get "Shape.STContains is not allowed, and the column name dbo could not be found or is ambiguous"

SELECT POLYGON.NAME, Count(*)
from Point JOIN
POLYGON
On POLYGON.Shape.STContains(POINT.SHAPE) = 1
GROUP BY POLYGON.NAME

 

Any assistance would be appreciated.

Outcomes