Skip to content

SqlServer - ATAN2 bearing calculation fails #532

@mmmries

Description

@mmmries

I couldn't find any existing issues filed for this. Sorry if it is a duplicate.

I'm using SqlServer at work (grudgingly) and using the standard SomeModel.near method results in this error:

ActiveRecord::StatementInvalid: TinyTds::Error: 'ATAN2' is not a recognized built-in function name.

It looks like it is used to calculate the bearing. I am able to work around the problem by using something like:

MyModel.near('eiffel tower', 20.0, select_bearing: false)

But I had to dig through the source a bit for this. Maybe we should add some documentation about sql server or else change the default select_bearing option to be false when using TinyTds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions