Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'tiny_tds'
- MAX = ARGV.shift.to_i
- connections = (1..MAX).map do |n|
- TinyTds::Client.new host:'ss2008', username:'sa', password:'cheese'
- end
- results = connections.map do |c|
- c.execute("SELECT @@SPID AS [pid]").each.first['pid']
- end
- puts "Tested #{MAX} connections."
- puts "Process IDs: #{results.inspect}"
- connections.each { |c| c.close }
Add Comment
Please, Sign In to add comment