Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Created December 5, 2012 22:53
Show Gist options
  • Save rjattrill/4220246 to your computer and use it in GitHub Desktop.
Save rjattrill/4220246 to your computer and use it in GitHub Desktop.
DSN-less ODBC Connection with ruby-sequel
require 'sequel'
DB = Sequel.connect(:adapter=>'odbc',:driver=>'SQL Server Native Client 10.0',:server=>'localhost',:port=>1433, :uid=>'myuser',:pwd=>'mypass',:db_type=>'mssql')
DB.fetch("SELECT * FROM artist") do |row|
puts row
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment