Problem with paging and MS SQL


#1

am trying to get the index page going on my table I am using a table
on Micrsoft SQL Server, when showing a single row from the table it
works OK. but when accessing the index I am gettingthe following
error
message

ActiveRecord::ActiveRecordError: Incorrect syntax near ‘.’.: SELECT
*
FROM (SELECT TOP 15 * FROM (SELECT TOP 15 sproclogs.* FROM
sproclogs ORDER BY sproclogs.[id] ASC) AS tmp1 ORDER BY sproclogs.

[[id]] DESC) AS tmp2 ORDER BY sproclogs.[[id]] ASC

The trace that I am getting is:

:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/connection_adapters/abstract_adapter.rb:188:in log' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9/ lib/active_record/connection_adapters/jdbc_adapter.rb:581:inexecute’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9/
lib/active_record/connection_adapters/jdbc_adapter.rb:641:in select' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9/ lib/active_record/connection_adapters/jdbc_adapter.rb:566:injdbc_select_all’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all_with_query_cache' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/connection_adapters/abstract/query_cache.rb:81:incache_sql’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all_with_query_cache' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/base.rb:635:infind_by_sql’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/base.rb:1490:in find_every' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/base.rb:589:infind’
vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb:175:in
find_page' vendor/plugins/active_scaffold/lib/paginator.rb:66:incall’
vendor/plugins/active_scaffold/lib/paginator.rb:66:in page' vendor/plugins/active_scaffold/lib/paginator.rb:93:incall’
vendor/plugins/active_scaffold/lib/paginator.rb:93:in items' vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb: 66:indo_list’
vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb:
33:in list' vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb: 8:inindex’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:1253:in perform_action' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/filters.rb:617:incall_filters’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:610:in perform_action_with_filters' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/benchmarking.rb:68:inperform_action_with_benchmark’
C:/jruby-1.1.6/lib/ruby/1.8/benchmark.rb:293:in measure' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/benchmarking.rb:68:inperform_action_with_benchmark’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/rescue.rb:136:in perform_action_with_rescue' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/caching/sql_cache.rb:13:inperform_action_with_caching’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:34:in
cache' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/query_cache.rb:8:incache’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/caching/sql_cache.rb:12:in
perform_action_with_caching' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/base.rb:524:inprocess’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:606:in process_with_filters' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/session_management.rb:134:inprocess_with_session_management_support’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:392:in process' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:183:inhandle_request’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:110:in dispatch_unlocked' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:123:indispatch’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:122:in dispatch' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:132:indispatch_cgi’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:39:in dispatch' C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/ webrick_server.rb:103:inhandle_dispatch’
C:/jruby-1.1.6/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/
webrick_server.rb:74:in service' C:/jruby-1.1.6/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
C:/jruby-1.1.6/lib/ruby/1.8/webrick/httpserver.rb:65:in run' C:/jruby-1.1.6/lib/ruby/1.8/webrick/server.rb:173:instart_thread’