Ruby on Rails Tuesday, March 19, 2019

I'm using rails 5.1.6 with activerecord-sqlserver-adapter 5.1.6, tiny_tds 2.1.2. and SQL Server 2017. Databaseaccess is OK,

SQL (1.1ms) USE [MIST_Test]

User Load (1.5ms) EXEC sp_executesql N'SELECT [users].* FROM [users] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1 [["LIMIT", nil]]

ActiveRecord::StatementInvalid: TinyTds::Error: Incorrect syntax near '0'.: EXEC sp_executesql N'SELECT [users].* FROM [users] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1

from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-sqlserver-adapter-5.1.6/lib/active_record/connection_adapters/sqlserver/database_statements.rb:368:in `each'

Caused by TinyTds::Error: Incorrect syntax near '0'.

from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-sqlserver-adapter-5.1.6/lib/active_record/connection_adapters/sqlserver/database_statements.rb:368:in `each'

SQL Server needs an 'ORDER BY' to use the 'OFFSET' clause.

Can somebody help?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eb0c62b6-e606-4b4b-bd9c-1265ed17de77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

1 comment:

sneha said...

Your blog is in a convincing manner, thanks for sharing such an information with lots of your effort and time
ruby on rails training
ruby on rails training India
ruby on rails training Hyderabad

Post a Comment