Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'tiny_tds'
- require 'active_support/core_ext/hash/conversions'
- client = TinyTds::Client.new( username: 'sa',
- password: 'secret',
- host: '127.0.0.1',
- port: 1433,
- timeout: 0,
- database: 'ServiceBrokerMonolog')
- loop do
- results = client.execute("WAITFOR (RECEIVE * FROM Notifications);")
- results.each do |row|
- client.execute("END CONVERSATION '#{row['conversation_handle']}';")
- values = Hash.from_xml(row['message_body'])["root"]
- #<root><first type="string">lorem</first><second type="integer">0</second></root>
- puts values
- end
- end
Add Comment
Please, Sign In to add comment