empty strings select as null bug
Jeffrey Shaw <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAJYh909bu8C25O3-xT7rYxg7kE2r4_YJ+6uhBoY-R7Wk=V2sOQ@mail.gmail.com> |
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