On Fri, Feb 5, 2021 at 9:49 AM Eduardo Kortright <[email protected]> wrote:
> > Hello, > > I am using Sequel 5.41.0 to connect to a SQL Server database using the > tiny_tds gem and the tinytds adapter. > > I just noticed that when retrieving certain large columns the returned > value is getting truncated to 2,048 characters. > > In SQL Server, the columns are defined as nvarchar(max), which could hold > over 2 billion characters, but in my case I have values ranging from > several thousand to almost 4 million characters. > > When I execute DB.schema(:mytable), I see a property "max_chars" for the > nvarchar(max) column that has the value -1. Other columns defined as > nvarchar(4000), for example, show max_chars = 4000, and the returned value > can be as large as 4000 characters. > > Can you tell me how to handle the nvarchar(max) columns? > Try using the :textsize option when connecting, as described in: http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-tinytds . If that doesn't work, please post a minimal self contained example showing the problem and I'll test with it. The :max_chars schema entry being -1 is expected. The :max_length schema entry is the one Sequel uses to actually specify behavior such as setting validations, and it not set for cases where :max_chars < 0. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CADGZSSchrQ_4f22V8VY58h1%2BWwD%3D04%2BOciMnrvXTb%2BrDZ-aOpw%40mail.gmail.com.
