# Strange SQL Server error

**URL:** <https://www.ruby-forum.com/t/strange-sql-server-error/100384>\
**Category:** Rails\
**Created:** [February 2, 2006, 5:03pm UTC](https://www.ruby-forum.com/t/strange-sql-server-error/100384 "2006-02-02T17:03:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Conway](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jonathan\_Conway](https://www.ruby-forum.com/u/Jonathan_Conway)\
**Post date:** [February 2, 2006, 5:03pm UTC](https://www.ruby-forum.com/t/strange-sql-server-error/100384/1 "2006-02-02T17:03:53Z")

</div>

Hi,  
In an app I’m developing I’ve run into a strange problem. I’ve created  
some controllers and models using the scaffolding generator and  
everything seemed to work fine.  
However I’ve noticed that a particular model I’ve created always fails  
its tests and I can’t test it out in a browser due to the same error I’m  
getting which is:

ActiveRecord::StatementInvalid (DBI::DatabaseError: S1090 (0)  
[iODBC][Driver Manager]Invalid string or buffer length: SELECT \* FROM  
(SELECT TOP 10 \* FROM (SELECT TOP 10 \* FROM info\_lists ) AS tmp1 ) AS  
tmp2)

I’m connecting to a MS SQL Server 2000 via Freetds on a mac, which is  
probably something to do with my problem. It doesn’t matter if there’s  
data in the test database or not as it still fails.

Any help greatly appreciated

Jon

---

<div class="post-metadata">

**Author:** ![Jonathan\_Conway](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jonathan\_Conway](https://www.ruby-forum.com/u/Jonathan_Conway)\
**Post date:** [February 2, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/strange-sql-server-error/100384/2 "2006-02-02T17:34:12Z")

</div>

Sorry I was meant to say that I am using the Openlink ODBC drivers, not  
Freetds for Mac.

Jon

---

<div class="post-metadata">

**Author:** ![Jonathan\_Conway](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jonathan\_Conway](https://www.ruby-forum.com/u/Jonathan_Conway)\
**Post date:** [February 2, 2006, 10:18pm UTC](https://www.ruby-forum.com/t/strange-sql-server-error/100384/3 "2006-02-02T22:18:34Z")

</div>

You might try the Actual driver and see if it works wit that one. If  
so, then you’ll at least know it has something with the driver. The  
free use version of the Actual driver is severely limited, but at  
least you can find out if it works.

Jamie

---

<div class="post-metadata">

**Author:** ![Jonathan\_Conway](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jonathan\_Conway](https://www.ruby-forum.com/u/Jonathan_Conway)\
**Post date:** [February 3, 2006, 1:23pm UTC](https://www.ruby-forum.com/t/strange-sql-server-error/100384/4 "2006-02-03T13:23:19Z")

</div>

Yeah, you’re right it was the driver. In the end I went with Freetds  
instead and it solved the problem.

Cheers

Jon
