I have:
a table called
ABCwith columns(ID, County_Name, Lat, Long)in SQL server pre-filled with the values under its respective columns, except for County_Name column which is currently null.an ArcGIS SDE feature class - called
US_Countywith columns(id, County_Name, Shape).
I am trying is call the SQL Server Spatial native STintersects() to get the county name from the US_County feature into my other non-spatial ABC table. But I can't seem to get it working.
First I add in the Shape column to the ABC table like so:
ALTER TABLE ABC
ADD Shape AS geometry::Point(Long,Lat,4326);
Then I do the STIntersects() like so:
UPDATE ABC
SET County_Name = a.County_Name
FROM ABC c
JOIN US_County a
ON c.Shape.STIntersects(a.shape) =1;
Was wondering if the above SQL statements is correct?