I tried using SQL Server with Rails a few months ago, but in less than 1 hour I encountered 3 bugs on the adapter, so I simply gave up. I gave it another go now, and with just one simple table as below: create table task_type ( task_type_id bigint not null, name varchar(200) not null, constraint pk_task_type primary key clustered (task_type_id) with fillfactor=90 on primary ) I generated a Scaffold for this table. And set the TaskType primary key as below class TaskType < ActiveRecord::Base set_primary_key("task_type_id") end But it insists in using the ID column instead of my set task_type_id when listing the table, so I get the following error: Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Invalid column name ''id''. HRESULT error code:0x80020009 Exceção.: SELECT * FROM ( SELECT TOP 12 * FROM ( SELECT TOP 10 * FROM task_type ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC Has anybody used thorougly the SQL Server adapter and could comment on their experience? Mine has not been good so far. Thanks, Alessandro _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
yes, that is a reported bug at this time, the SQL Server Adapter does not have access to the model in which you are overriding to primary key. in the mean time, you can side step this particular bug by adding a specific :order clause to your paginators, such as :order => TaskType.primary_key ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Alessandro Cauduro Sent: Thursday, 1 September 2005 11:21 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] SQL Server Adapter still buggy? I tried using SQL Server with Rails a few months ago, but in less than 1 hour I encountered 3 bugs on the adapter, so I simply gave up. I gave it another go now, and with just one simple table as below: create table task_type ( task_type_id bigint not null, name varchar(200) not null, constraint pk_task_type primary key clustered (task_type_id) with fillfactor=90 on primary ) I generated a Scaffold for this table. And set the TaskType primary key as below ... class TaskType < ActiveRecord::Base set_primary_key("task_type_id") end But it insists in using the ID column instead of my set "task_type_id" when listing the table, so I get the following error: Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Invalid column name ''id''. HRESULT error code:0x80020009 Exceção.: SELECT * FROM ( SELECT TOP 12 * FROM ( SELECT TOP 10 * FROM task_type ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC Has anybody used thorougly the SQL Server adapter and could comment on their experience? Mine has not been good so far. Thanks, Alessandro _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
>> Has anybody used thorougly the SQL Server adapter and could comment on their experience? Mine has not been good so far.btw, I''ve been using it heavily and it works fine if you have an ''id'' field as opposed to choosing to override "The Rails Way TM" with set_primary_key Neville ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Alessandro Cauduro Sent: Thursday, 1 September 2005 11:21 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] SQL Server Adapter still buggy? I tried using SQL Server with Rails a few months ago, but in less than 1 hour I encountered 3 bugs on the adapter, so I simply gave up. I gave it another go now, and with just one simple table as below: create table task_type ( task_type_id bigint not null, name varchar(200) not null, constraint pk_task_type primary key clustered (task_type_id) with fillfactor=90 on primary ) I generated a Scaffold for this table. And set the TaskType primary key as below ... class TaskType < ActiveRecord::Base set_primary_key("task_type_id") end But it insists in using the ID column instead of my set "task_type_id" when listing the table, so I get the following error: Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Invalid column name ''id''. HRESULT error code:0x80020009 Exceção.: SELECT * FROM ( SELECT TOP 12 * FROM ( SELECT TOP 10 * FROM task_type ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC Has anybody used thorougly the SQL Server adapter and could comment on their experience? Mine has not been good so far. Thanks, Alessandro _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Alessandro, I have found the same thing with the SQL Server adaptor. I was able to get a little bit further with the help of this list. If you send me your email address off line, I can send you my changes to the adaptor code htat made it a little bit better. My email is rdifrango at captechventures dot com Ron -----Original Message----- From: Alessandro Cauduro [mailto:news@w3haus.com.br] Sent: Thu 9/1/2005 9:20 AM To: rails@lists.rubyonrails.org Cc: Subject: [Rails] SQL Server Adapter still buggy? I tried using SQL Server with Rails a few months ago, but in less than 1 hour I encountered 3 bugs on the adapter, so I simply gave up. I gave it another go now, and with just one simple table as below: create table task_type ( task_type_id bigint not null, name varchar(200) not null, constraint pk_task_type primary key clustered (task_type_id) with fillfactor=90 on primary ) I generated a Scaffold for this table. And set the TaskType primary key as below … class TaskType < ActiveRecord::Base set_primary_key("task_type_id") end But it insists in using the ID column instead of my set “task_type_id” when listing the table, so I get the following error: Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Invalid column name 'id'. HRESULT error code:0x80020009 Exceção.: SELECT * FROM ( SELECT TOP 12 * FROM ( SELECT TOP 10 * FROM task_type ) AS tmp1 ORDER BY id DESC ) AS tmp2 ORDER BY id ASC Has anybody used thorougly the SQL Server adapter and could comment on their experience? Mine has not been good so far. Thanks, Alessandro _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails