I need to load point data in SQL Server Spatial.
Similar to this post but I really don't know how to get XY data to be accessible by SQL
I want to do what was done in the initial part of this post (Identify points that plot inside the polygon):
How do I find points that are NOT within a list of polygons using MS SQL?
SELECT points.name, polygons.name
FROM points CROSS JOIN
polygons
WHERE (polygons.shape.STContains(points.shape) = 1)
How do you get the points loaded into your table and SQL to recognize the points with out having to define them like the below?
insert into @points values
(geometry::Point(1,1,0)),
(geometry::Point(2,3,0)),
(geometry::Point(5,4,0)),
(geometry::Point(4,2,0))
I am having a hard time defining points without doing it manually like above.
Ideally I could build a table like this by selecting the xy data I have in a table already.