High Tech Sorcery

Accessing MS SQL Server from Rails without ODBC

by on Mar.18, 2011, under Ruby On Rails

I found myself looking through the code for activerecord-sqlserver-adapter and noticed a new mode called “dblib”.  It turns out this mode can be used when using the tiny_tds gem along with FreeTDS to avoid using ODBC altogether.  I decided to try it out on a project and have found it to work very well so far.  The update_sql call no longer has to make a call to get the number of affected rows, something which was slowing down the code significantly.  I don’t have many benchmarks yet but it looks like performance is up or has remained constant across the board.  I’m not sure if there are any problems that might come up, certainly TinyTDS is a relatively new project.  But for now I’m enjoying not having to use ODBC and hopefully this will continue to work well moving forward.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...