Prev: Where to host the Ruby Project Source Code
Next: lt operator on class object, checking a class' superclasses
From: Parul Korea on 6 Aug 2010 03:49 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 6 Aug 2010 08:36
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/. |