Skip to main content
QUICK REVIEW

[Paper Review] Using Table Valued Functions in SQL Server 2005 To Implement a Spatial Data Library

Jim Gray, Alexander S. Szalay|ArXiv.org|Jan 26, 2007
Data Management and AlgorithmsComputer Science3 references10 citations
TL;DR

This paper presents a spatial data library for SQL Server 2005 using table-valued functions to enable efficient spatial queries like point-near-point and point-in-polygon. It leverages the public-domain C# Hierarchical Triangular Mesh (HTM) algorithm, exposed via SQL Server UDFs, to provide a scalable, code-free spatial indexing solution without requiring application-level modifications.

ABSTRACT

This article explains how to add spatial search functions (point-near-point and point in polygon) to Microsoft SQL Server 2005 using C# and table-valued functions. It is possible to use this library to add spatial search to your application without writing any special code. The library implements the public-domain C# Hierarchical Triangular Mesh (HTM) algorithms from Johns Hopkins University. That C# library is connected to SQL Server 2005 via a set of scalar-valued and table-valued functions. These functions act as a spatial index.

Motivation & Objective

  • To enable efficient spatial querying in SQL Server 2005 without application-level code changes.
  • To integrate the public-domain C# HTM spatial algorithms into SQL Server via database functions.
  • To provide a reusable, scalable spatial indexing mechanism using table-valued functions.
  • To support common spatial operations such as point-near-point and point-in-polygon searches.
  • To demonstrate that complex spatial functionality can be exposed through standard SQL Server UDFs.

Proposed method

  • Exposing the C# Hierarchical Triangular Mesh (HTM) algorithms as SQL Server table-valued functions.
  • Using scalar-valued and table-valued functions to bridge C# logic with T-SQL queries.
  • Implementing spatial indexing logic within SQL Server using HTM-based spatial partitioning.
  • Designing UDFs to return result sets that represent spatial query outcomes (e.g., nearby points).
  • Ensuring compatibility with standard SQL Server 2005 T-SQL syntax for seamless integration.
  • Validating functionality through execution of common spatial queries using the UDFs.

Experimental results

Research questions

  • RQ1How can spatial query capabilities be added to SQL Server 2005 without modifying application code?
  • RQ2Can table-valued functions effectively expose complex spatial algorithms like HTM to T-SQL?
  • RQ3What performance and scalability characteristics does a UDF-based spatial library achieve in SQL Server 2005?
  • RQ4How accurately and efficiently can point-near-point and point-in-polygon queries be executed using this approach?
  • RQ5To what extent can a database-native spatial library reduce the need for application-level spatial logic?

Key findings

  • The library successfully enables point-near-point and point-in-polygon queries through T-SQL using table-valued functions.
  • The integration of C# HTM algorithms via UDFs provides a scalable and efficient spatial indexing mechanism.
  • Spatial queries can be executed without modifying application code, relying solely on database functions.
  • The approach demonstrates that complex spatial operations can be abstracted and exposed through standard SQL Server UDFs.
  • The solution leverages existing SQL Server 2005 features to deliver spatial functionality with minimal infrastructure changes.
  • The method supports production-level spatial querying with predictable performance and correctness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.