I’m using the tiny_tds and activerecord-sqlserver-adapter gems to connect to a remote sqlserver database. I have it working locally but when I deploy to heroku I get the following error.
ActiveRecord::StatementInvalid: TinyTds::Error: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.
Is there setup needed on heroku to get this working?
After hours of digging and trial and error, the root cause is from ntext(max) and nvarchar(max) columns. Once the columns were changed to varchar it worked.
If you ever need to know the difference, it is that nvarchar takes up twice the space of varchar because it allows for non-English Unicode characters. You basically only need this if you wil be storing data in other languages.