Skip to content

Instantly share code, notes, and snippets.

@ouaziz
Created August 2, 2016 14:39
Show Gist options
  • Save ouaziz/9e790f1583a7a26ce6460f8c021f83db to your computer and use it in GitHub Desktop.
Save ouaziz/9e790f1583a7a26ce6460f8c021f83db to your computer and use it in GitHub Desktop.
puts "start..."
require 'tiny_tds'
client = TinyTds::Client.new username: 'sa', password: '123***s', host: '192.168.1.215', port: 1433, database: 'alyamama'
#results = client.execute("SELECT * FROM motif_controle")
#puts results.fields
#results.each do |row|
# puts row
#end
#puts "---------------"
results = client.execute("EXEC sp_test")
#results.do
results.each do |row|
puts row.values_at("CodeMotif")
puts row.values_at("Description")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment