• Hi

    Having another look at your query, the points you are creating for the fact table are in a straight line on a zero y coordinate, unless you are creating a point with zero height.

    FROM #fact_table ip

    LEFT JOIN GEO2IP tr ON geo_range.STWithin(geometry::STGeomFromText(

    'POINT('+CONVERT(varchar(20),ip.IP_Converted)+' 0)',0)) = 1

    So when you build a point it will look something like POINT(2155.21 0), this may be part of your problem.

    Can you give us an example of a point that you are querying with and a geo_range from your geo2ip table

    SELECT TOP 1 geometry::STGeomFromText('POINT('+CONVERT(varchar(20),ip.IP_Converted)+' 0)',0).ToString() FROM #fact_table;

    SELECT TOP 1 geo_range.ToString() FROM geo2ip;