Skip to Content.
Sympa Menu

freetds - Re: [freetds] Connecting to SQL Server 2008 from Ubuntu 8.04

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Connecting to SQL Server 2008 from Ubuntu 8.04
  • Date: Fri, 11 Sep 2009 09:07:18 +0200

2009/9/11 Nick Tidey <nicktidey AT gmail.com>:
> Hi
>
> I'm seeing some strange behaviour connecting to a Server 2008 database
> from Ubuntu 8.04 using unixODBC. This may well be a unixODBC issue?
>
> With freetds.conf configured like so:
>
>   tds version = 8.0
>   client charset = UTF-8
>
> I see the following:
>
> root@u804:/etc/freetds# isql activerecord_unittest_2008 <username>
> <passwd>
> SQL> select getdate();
> [ISQL]ERROR: Could not SQLPrepare
>
> Running with TDSDUMP=stderr shows an error "the incoming tabular data
> stream remote procedure call protocol stream is incorrect, data type
> 0x38 is unknown".
>

It's a know problem. Update FreeTDS. 0x38 is a not-nullable INTEGER,
mssql 2005 does not support this type some parameters (you need to
pass a nullable integer) while mssql 2000 doesn't have this problem.

> Full output is here: http://pastie.org/613265
>
> Change TDS version to 7.0 shows the following:
>
> SQL> select getdate();
> +-------------------------+
> |                         |
> +-------------------------+
> | 2009-09-11 16:25:01.800 |
> +-------------------------+
> SQLRowCount returns 1
> 1 rows fetched
> SQL> select * from events;
> +------------+---------------------+
> | id         | title               |
> +------------+---------------------+
> +------------+---------------------+
> SQLRowCount returns -1
>
> A few questions:
>
> - Is the row count of -1 for an empty table the expected return value
> in TDS version 7.0 or is something else broken in this case?
>
> - Is 7.0 an appropriate version to use for a 2008 server? Do I lose
> anything apart from bigint support?
>
> - From what I could glean from Microsoft's TDS "documentation" 2005
> uses TDS version 7.2. The FreeTDS version makes no mention of a 7.2
> though, so am I misunderstanding something here?
>

Future version will update version to Microsoft way. Now consider 8.0
== 7.1. mssql 2005 support versions 4.2, 7.0, 7.1 and 7.2 of the
protocol. Usually 7.0 suffice for main use, 7.1 add collations for
columns and some additional types.

Regards
Frediano




Archive powered by MHonArc 2.6.24.

Top of Page