Search code examples
sqlsql-serverindexingsqlgeography

SQL Server - Mismatch in column datatype and tessellation scheme


I'm trying to create an index on my Location column in the DB.

Receiving this error: Mismatch in column datatype and tessellation scheme

It's a simple Geography computed field of a Latitude and Longitude field.

[Location]  AS ([geography]::Point([Latitude],[Longitude],(4326))) PERSISTED,

What am I doing wrong here?

In my app I'm filtering heavily on this Location column so I want to make sure it's indexed.

enter image description here


Solution

  • I had the same issue. Click the "Spatial" Column on the left and under the "General" section, where it says Tessellation Scheme, select "Geography Grid". It is defaulted to Geometry which is causing the issue.

    enter image description here