Assuming you have FreeTDS installed (easily through macports) and iODBC (comes out of the box with Mac OS X) then this is all you need in your database.yml file:
development:
adapter: sqlserver
mode: odbc
dsn: DRIVER=/opt/local/lib/libtdsodbc.so;TDS_Version=8.0;SERVER=10.0.6.20;DATABASE=awesome_development;Port=1433;uid=sa;pwd=password;
No configuration of a DSN required, and no mucking about with freetds.conf!
Now, if I could just use database.yml to get rid of SQL Server all together, I'd be a happy developer.
4 comments:
Note the same is true for other ODBC accessible databases using the same DSN-less connection support mechanism added for Rails 1.5 and 2.x as detailed at:
http://odbc-rails.rubyforge.org/RailsAdapterWebGeneralInformation.html
"Now, if I could just use database.yml to get rid of SQL Server all together, I’d be a happy developer."
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
Problem solved. ;-)
Note the same is true for other ODBC accessible databases using the same DSN-less connection support mechanism added for Rails 1.5 and 2.x as detailed at:
http://odbc-rails.rubyforge.org/RailsAdapterWebGeneralInformation.html
"Now, if I could just use database.yml to get rid of SQL Server all together, I’d be a happy developer."
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
Problem solved. ;-)
Post a Comment