TinyTDS is a Ruby library to access Microsoft SQL Server databases using FreeTDS.
Questions tagged [tiny-tds]
149 questions
2
votes
0 answers
TinyTds - problems connecting to Azure SQL database using '@' in username
I was given credentials to access an Azure SQL Database and am trying to connect via TinyTds:
#!/usr/bin/env ruby
require 'tiny_tds'
server = 'xxx.database.windows.net'
database = 'yyysqldb03'
username =…

patschiboy
- 1,091
- 8
- 21
2
votes
1 answer
Rails: Active Record Timeout
This is a piece of code in place. When I add this to the cron with timeout the entire array gets saved twice. When I remove timeout nothing gets saved
In this scenario we would want to save the array results (coming in from an api) with over 100k…

SureshCS
- 1,005
- 12
- 23
2
votes
1 answer
Active-sqlserver-adapter with Rails 5 application.
I am trying to set up a new application with rails 5. I have a half dozen applications working fine with rails 4.x.
When I try to do a bundle install, I get an error that starts with
Error:[rake --tasks] DEPRECATION WARNING: alias_method_chain is…

Chris Mendla
- 987
- 2
- 10
- 25
2
votes
2 answers
Rails and Azure: TinyTds::Error: Adaptive Server connection failed
I'm trying to configure my Rails project with SQL on Azure. I'm using Mac OS X 10.11.
This is part of my config/database.yml:
staging:
adapter: sqlserver
mode: dblib
host: db-staging.database.windows.net
port: 1433
database: db-staging
…

monteirobrena
- 2,562
- 1
- 33
- 45
2
votes
2 answers
Streaming large files using TinyTDS/FreeTDS
When I run a simple select on a row, I only get about 64K of data for BLOB columns. I'd like to get all of it, streaming would be preferable of course to avoid memory problems.

eltiare
- 1,817
- 1
- 20
- 28
2
votes
1 answer
How can I use SQL Server Table Views as Rails Models (Read Only)?
I'm using SQL Server as my database for my Rails project. I'm trying to create some models to use for a 3rd party database and only want to read from this database. So I made a view of the table I wanted to create an object for and then I wanted to…

daveomcd
- 6,367
- 14
- 83
- 137
2
votes
1 answer
`rake db:schema:dump` creates schema with empty system tables
I am creating test and development databases that mirror the schema of an existing production database. First, I create db/schema.rb by dumping the production schema:
RAILS_ENV=production rake db:schema:dump
This creates a schema.rb which has an…

Wayne Conrad
- 103,207
- 26
- 155
- 191
2
votes
2 answers
How to keep a persistent connection to SQL Server using Ruby Sequel and Tiny_TDS while in a loop
I have a ruby script that needs to run continually on the server. I've daemonized it using the daemon gem, and in my script I have it running in an infinite loop, since the daemon gem handles starting and stopping of the process that kicks off my…

irnmn
- 726
- 4
- 20
2
votes
2 answers
Remove square brackets from array?
I have an array that I'm trying to load into a SQL statement. When I compile the SQL statement and include the array, it also puts the [] brackets into the string, and I need to remove them in order to insert it into my DB.
Here's my code:
i =…

hyphen
- 957
- 1
- 11
- 31
2
votes
3 answers
Ruby on Rails with Sql Server (incompatible character encodings: UTF-8 and ASCII-8BIT)
is there any way to assign the string encoding to UTF-8 in Ruby On Rails 3?
Database Server: Windows Server 2008 R2
PC: Debian Squeeze.
I use Sql Server 2008 with ODBC and found (config/database.yml):
development:
adapter: sqlserver
host:…

fechidal89
- 723
- 5
- 25
2
votes
2 answers
Loop through and list a 2 column db table from Tinytds via ruby with column1 values as headings and column2 values as a list
I've been trying to learn the basics of loops and I'm getting there but I'm struggling to get my brain around the following requirement where, for example, I've got data from a database table via tinytds, such that key/values are hashed into an…

lad33
- 65
- 6
2
votes
0 answers
TinyTds::Error: Unable to open socket
I've researched this for a few hours now and I can't seem to find a solution.
I have a Rails 2 app that uses the TinyTds gem ( tiny_tds ) to connect to an SQL 2000 server hosted locally in our company.
The app has been connecting to SQL Server…

Nmuta
- 345
- 4
- 15
1
vote
2 answers
friendly_id does not work with sql server and tiny_tds?
I am using friendly_id 4.0.0 rails 3.0.1 and tiny_tds 0.2.3 (because I have a sql server database as a backend for the rails application)
In my model I have
extend FriendlyId
friendly_id :friendly_name, :use => [:slugged]
When I try to create a…

ami
- 81
- 1
- 5
1
vote
4 answers
tiny_tds failed at the second execute
Today, tiny_tds suddenly does not accept more than one execute and returns:
C:\>ruby test_use.rb
one
two
C:/test_use.rb:15:in `execute': Attempt to initiate a new Adaptive Server operation with results pending (TinyTds::Error)
from…

ohho
- 50,879
- 75
- 256
- 383
1
vote
1 answer
Cannot install tiny_tds on Windows
I've been trying to install tiny_tds on Windows using RubyGems. I'm using Ruby 2.5.9p229. Also installed the Developer Tools but I'm always getting following error. Tried with and without freetds-dir.
C:\JenkinsWorkspaces\PMS_master@2>gem install…

d151
- 11
- 4