Rails and SQL Server 2005 Express

I was looking at the Wiki in regards to info on getting Rails and SQL
Express 2005 to place nice together but the wiki seems to have some old
material on it. Can anyone tell me if Rails does indeed support SQL
Express 2005 and how to go about correctly adding support for it from a
Windows (Vista) machine? Also, is anyone currently using SQL Express
2005 and Rails together?

Here is the page I was reading:
http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServer

Thanks for your help.

Hi,

A Rails app can connect to SQL Server 2005 Express. The main issue of
which
to be aware, though, is that Express installs as a named instance by
default. Therefore, in your database.yml file, you must provide both the
server name (your machine name) and the named instance (SQLEXPRESS by
default). For example:

test:
adapter: sqlserver
mode: ado
database: sql2k5_spike_test
username: user
password: pwd
host: DBI:ADO:Provider=SQLOLEDB;Data Source=MACHINE_NAME\SQLEXPRESS;

Note that I had to use uppercase for the machine\instance. Furthermore,
neither localhost (uppercase or lowercase) nor 127.0.0.1 would suffice
in
place of my machine name. This is unfortunate if multiple people will be
working on the project, as each of their machine names will be unique.

Therefore, you should consider installing Express as a default (unnamed)
instance. If you’ve already installed as a named instance, you’ll have
to
reinstall as a default instance. Then you can just use localhost in
place of
machine\instance for development and test.

test:
adapter: sqlserver
mode: ado
database: sql2k5_spike_test
username: user
password: pwd
host: DBI:ADO:Provider=SQLOLEDB;Data Source=localhost;

Almost forgot… I did all of this on Windows XP Pro, as I don’t have
access to Vista. You’ll just have to give it a try and let us know how
it
goes. :slight_smile:

Regards,
Craig