Hi @LooneyOMooney ,
Thank you so much for posting here.
Please refer below and check whether it is helpful:
select A.*, B.*
FROM TableA A WITH(INDEX([SPATIAL_INDEX_NAME]))
LEFT OUTER JOIN TableB B
ON A.Shape.STCentroid().STIntersects(B.Shape) = 1
You could consider to add an index hint " WITH(INDEX(...)) " as this will speed up the query.
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues November--What can I do if my transaction log is full?
Hot issues November--How to convert Profiler trace into a SQL Server table