This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Blue and terracotta ceramic beads beside an open wooden case containing a green bead.

geometry STAsText: Z and M Values Need a Different Export

May 20, 2011
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STAsText returns spatial text without the Z and M values carried by an instance. I compare it with ToString using two points. Identical XY text can hide a difference in the original payload.

Read More
Two overlapping pale ceramic tiles beside a terracotta slab and blue and sage stones.

geometry STDistance: Measure the Closest Points of Two Shapes

April 19, 2011
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STDistance measures the shortest distance between points belonging to two represented shapes. I compare an interior gap with an endpoint gap. Intersecting shapes provide a useful zero-distance case.

Read More
Gouache painting: on a music room shelf, one tambourine hangs beside a stacked trio of tambourines

geometry STGeometryType: Type Names Say More Than Dimension

March 7, 2011
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STGeometryType identifies the represented shape type, which carries more information than its dimension. I compare single and multiple shapes in one small query. Equal dimensions do not mean that their structures are interchangeable.

Read More
Gouache painting: a battered tin box with its lid propped open stands on a bench

geometry Collections: Read Members With STGeometryN

December 22, 2010
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry Collections hold member shapes that STGeometryN can return individually. I extract a point and a line from one fixed collection. A third request deliberately exceeds its member count.

Read More
Gouache painting: three positions along a tack room wall

geometry STIsEmpty: Empty Shapes Are Different From SQL NULL

November 24, 2010
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STIsEmpty tests whether an existing spatial instance has an empty point set. I keep that condition separate from SQL NULL. A missing database value and a present empty geometry are different inputs.

Read More
A drawing compass on cream paper, its pencil arc just touching the nearest of several scattered pebbles.

Finding the Nearest Location With a Spatial Index

September 19, 2010
Pinal Dave
SQL Performance
Execution Plan, Spatial Database, SQL Index, SQL Server

A nearest location query in SQL Server needs TOP, STDistance in WHERE and ORDER BY, matching SRIDs, and a checked spatial plan.

Read More
An archaeological dig divided by strings into square cells, a trowel working in one small cell with a red shard.

Spatial Indexes: Speeding Up Distance Searches

August 24, 2010
Pinal Dave
SQL Performance
Execution Plan, Spatial Database, SQL Index, SQL Server

Use spatial indexes for geography distance searches, compare actual plans and reads, and inspect tessellation with built-in diagnostics.

Read More
Previous 1 2 3 4 5 6 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com