[RoR] mssql adapter and set_primary_key problem

J

JZ

For mssql adapter I cannot change primary key. The following code does not
work :(

class Demo < ActiveRecord::Base
set_table_name "MojaTabela"
set_primary_key "IdMojejTabeli"
end

Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Invalid column name 'id'.
HRESULT error code:0x80020009
Exception.: SELECT * FROM ( SELECT TOP 9 * FROM ( SELECT TOP 9 * FROM
MojaTabela ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC

The error exception appears for mode ADO and for mode ODBC. Something wrong
is here. I tried to ask on irc rubyonrails channel but nobody said any
word. Mysql adapter works fine. Only mssql adapter has problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top