6

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

aherrick
  • 19,799
  • 33
  • 112
  • 188

1 Answers1

20

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

Michael Bondi
  • 296
  • 3
  • 6
  • 2
    This should be accepted answer this did it for me, thanks Michael. – Matas Vaitkevicius Jan 12 '16 at 21:28
  • @Michael Bondi, I know it's been so long, but can you tell me if it runs for hours to create spatial index. My data set is about 30k rows and it's been running from 7 hours or so. – Sree Apr 30 '19 at 16:33
  • @Sree It didn't take that long for me but I only had a few thousand records or so - there are a lot of factors that could affect the time, like people querying the database which can cause locks, if other indexes exist on that table (clustered, etc), disk space, even the SQL edition (Standard vs Enterprise). Unfortunately my knowledge of the inner workings of SQL server isn't that in depth to really provide a useful answer for you; you might have to just wait it out. – Michael Bondi May 01 '19 at 19:31