由于名为STContains的地理空间函数仅在SQL Server 2012中可用,因此我可以使用类似的函数在SQL Sever 2008中获得相同或类似的结果吗?
STIntersects是否可行?
干杯!
答案 0 :(得分:2)
STContains
IS 。
DECLARE @s0 AS GEOMETRY = 'POLYGON((4 4, 7 4, 7 7, 4 7 ,4 4))'
DECLARE @s1 AS GEOMETRY = 'POLYGON((5 4.2, 6 4.2, 6 5, 5 5, 5 4.2))'
SELECT *
FROM (
SELECT @s0 AS 'Geo', 'S0' as 'Labels'
UNION ALL SELECT @s1, 'S1'
) AS A
WHERE A.Geo.STContains(@S1) = 1