Ruby on Rails
SQL Server

See also: DatabaseDrivers
See also: HowtoConnectToMicrosoftSQLServer
See also: HowtoConnectToMicrosoftSQLServerFromRailsOnLinux
See also: HowtoConnectToMicrosoftSQLServerFromRailsOnOSX

Rails 0.9.5 ships with a SQL Server adapter. You need the ADO driver from Ruby-DBI to make it work. I’m not sure if this qualifies it to be listed among the “supported” DatabaseDrivers.

The project homepage does not appear to provide a link to download the source. This alternate link for Ruby-DBI should be helpful.

activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb

From the file:

This adapter will ONLY work on Windows systems, since it relies on Win32OLE, which,
to my knowledge, is only available on Window.

It relies on the ADO support in the DBI module. If you are using the
one-click installer of Ruby, then you already have DBI installed, but
the ADO module is NOT installed. You will need to get the latest
source distribution of Ruby-DBI from http://ruby-dbi.rubyforge.org/
unzip it, and copy the file src/lib/dbd_ado/ADO.rb to
X:/Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb (you will need to create
the ADO directory). Once you’ve installed that file, you are ready to go.

This module uses the ADO-style DSNs for connection. For example:
“DBI:ADO:Provider=SQLOLEDB;Data Source=(local);Initial Catalog=test;User Id=sa;Password=password;”
with User Id replaced with your proper login, and Password with your
password.

I have tested this code on a Windows XP Pro SP1 system,
ruby 1.8.2 (2004-07-29) [i386-mswin32], SQL Server 2000.

For *nix, you could potentially write an adapter based on FreeTDS