From: Parul Korea on
I need to connect to SQL server 2005 using Ruby. I went through some
posts but did not found much help.
It would be great if anyone can help me with this.
--
Posted via http://www.ruby-forum.com/.

From: Damjan Rems on
Parul Korea wrote:
> I need to connect to SQL server 2005 using Ruby. I went through some
> posts but did not found much help.
> It would be great if anyone can help me with this.

ODBC is the way.

Linux: Search for "odbc freetds ruby mssql" in google.

Windows: I use DBI with ODBC support. Should not be trouble searching on
google. Here is something to start from.

require 'dbi'
dbh = DBI.connect('DBI:ODBC:Driver={SQL Server};
Server=MYSQL2005;Database=mydb;Uid=myusr;Pwd=mypwd')

dbh.select_all("select * from some_table") do |r|
somefield = r[2].downcase
end
dbh.disconnect


by
TheR
--
Posted via http://www.ruby-forum.com/.