首页 > 解决方案 > 在执行用户定义的例程或聚合“没有可用的扩展信息”期间发生 .NET Framework 错误。呼唤地理

问题描述

我正在尝试从一个表中提取纬度/经度坐标,看看它们是否与使用几何::STIntersect 的特定区域相交。但是,在查询开始运行并产生结果后,标题中出现错误。不过,这只是间歇性地发生。下面是我正在尝试做的伪代码示例:

SELECT *
FROM table_with_lat_lons
INNER JOIN(SELECT id,1 include 
    FROM table_with_lat_lons 
    INNER JOIN table_with_geog_boundaries 
    ON table_with_geog_boundaries.geog.STIntersects(geography::Point(ISNULL(CAST(y_Coord as float),0.0), ISNULL(Cast(x_Coord as float),0.0), 4326)) = 1) bounds 
    ON table_with_lat_lons.id =bounds.id
    WHERE bounds.include=1

将所有内容包装成 with...then 将修复错误,但这对我来说不是解决此问题的可行解决方案

标签: sqlsql-servertsqlsqlgeography

解决方案


推荐阅读