Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FinderMethods#exists? does not work with SQL Server #2553

Closed
iaddict opened this issue Aug 17, 2011 · 2 comments
Closed

FinderMethods#exists? does not work with SQL Server #2553

iaddict opened this issue Aug 17, 2011 · 2 comments

Comments

@iaddict
Copy link
Contributor

iaddict commented Aug 17, 2011

The generated SQL does not work with SQL Server. Following the AR exception:

ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: No column was specified for column 2 of 't'.: SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY huhu.id) AS _row_num, 1 FROM huhu WHERE huhu.[id] = 83287) AS t WHERE t._row_num BETWEEN 1 AND 1

The problem is the column '1' that has no alias. It has to read something like 1 as _one.

A pull request exists that fixes this issue: #1141

@iaddict
Copy link
Contributor Author

iaddict commented Aug 29, 2011

Why ohh why does no one care!?

Please apply the patch.
Many thanks!

@carlosantoniodasilva
Copy link
Member

Same as #1139, please follow instructions there if the issue still exists on latest Rails version, I'm closing this one. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants