Skip to Content.
Sympa Menu

freetds - [freetds] empty strings select as null bug

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jeffrey Shaw <shawjef3 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] empty strings select as null bug
  • Date: Wed, 10 Jun 2015 10:27:13 -0400

When I reported this dblib bug to this list before I got it backwards. I
said NULL strings were being selected as empty strings, but it's the other
way around.

When I use TDS Version >= 7.0, empty strings are selected as NULL.

When I use TDS Version = 4.2, empty strings are empty.

I have a table in SQL Server 2008 R2 that is (int, varchar(max)). I insert
one row with an empty string. Selecting it from management studio gives
this:

select id, case when string is null then 1 else 0 end AS [is null] from
dbo.strings

id is null
1 0

I can use PostgreSQL's tds_fdw to use dblib to select from SQL Server. The
query is

select id, string is null from distribution.dbo_strings;

TDS Version = 4.2
id | ?column?
----+----------
1 | f

TDS Version = 7.0
id | ?column?
----+----------
1 | t




Archive powered by MHonArc 2.6.24.

Top of Page