Advertisement
Guest User

Untitled

a guest
Jul 8th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. require 'tiny_tds'
  2. require 'csv'
  3.  
  4. ## Connect to database
  5. client = TinyTds::Client.new username: 'ISO_AVM', password: '<db-password>', host: '<hostname or IP>', port: 1433, database: 'ISO_AVM2'
  6.  
  7. if client.active?
  8. puts 'Connection successful!'
  9. end
  10.  
  11. ## Open and readCSV file
  12.  
  13. CSV.foreach("/home/jonas/RubymineProjects/ISO-AVM/test.csv") do |row|
  14. puts row.inspect
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement