Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9136197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:55:16+00:00 2026-06-17T08:55:16+00:00

After some anguish trying to connect to a SQLServer database with Ruby, I finally

  • 0

After some anguish trying to connect to a SQLServer database with Ruby, I finally discovered TinyTDS and it’s fantastic.

However, it requires a username and password to talk to the database. In C# tests in the past, we’ve used SSPI to supply this, so that any tester can pick up a script and run it and it’ll use their Windows Authentication details.

I can’t find a way to do this with TDS (beginning to suspect it’s not possible with the current version) and hoping someone might prove me wrong, or have another suggestion?

Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:55:17+00:00Added an answer on June 17, 2026 at 8:55 am

    Found the solution.

    My install of tiny-tds was version 0.51.

    The latest version has SSPI, and so to get that:

    gem install tiny_tds --version ">= 0.6.0.rc1"
    

    This comes with no need to specify a username/password and use SSPI by default.

    So as an example:

    require  'tiny_tds'
    
        sql = "SELECT name from sys.databases"
        client = TinyTds::Client.new(:dataserver => "myserver", :database => "mydatabase")
        result = client.execute(sql)
        results = result.each(:symbolize_keys => true, :as => :array, :cache_rows => true, :empty_sets => true) do |rowset| end
        #THIS IS TO OUTPUT IT TO THE CONSOLE
        for i in (0..result.fields.length)
          printf("%14s", result.fields[i])
        end
        for j in (0...result.affected_rows)
          puts ""
          for i in (0...result.fields.length)
            printf("%14s",results[j].at(i))
          end
        end
    

    Will print out a list of the database names, using SSPI to access the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some time researching and trying different things I still cannot get my @ExceptionHandler
After some hours of trying, I want to ask how to loop a video
After some experimentation, I've ended up with the following code, trying to replicate the
After some 3 hours trying to make gettext work I noticed it doesn't worked
Just after some advice regarding this database design situation. So I have two tables
After some efforts I finally get cobertura running correctly for my web application on
After some considerable amount of time while trying to build the ffmpeg static library
after some months of coming here now and then it's finally my turn to
So after some fantastic help from users here I now have a button to
After some desperate assistance regarding prototype.js on Magento. Please see the below product page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.