Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQLDescribeParam ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] SQLDescribeParam ?
  • Date: Tue, 2 Oct 2012 00:36:02 -0400

On Sun, 30 Sep 2012 20:57:43 +0200
Björn Lundin <b.f.lundin AT gmail.com> wrote:

> Anyway, my real problem is that when I have a DateTime2(3) column,
> SQLDescribeParam returns
> * SQL_VARCHAR
>
> with MS native windows driver I get one of (not sure which, I treat
> them equally)
> * SQL_TYPE_TIMESTAMP
> * SQL_DATETIME
>
> Is there a way around this, to tell the client library to return a
> correct datatype?

The library reports what it received from the server. The server
converted the SQL DATETIME2(3) datatype of the column to varchar
for compatibility with the TDS version you're using.

If you check with TDSDUMP, I believe you'll find you're connecting with
TDS 7.2. The first version of the protocol to support DATETIME2 is
TDS 7.3. The current release, 0.91, doesn't support TDS 7.3; to get
that, you'll need to use a recent snapshot.

(The snapshots are once again broken. I haven't had a chance to figure
out why. To get the absolute latest, you need git.)

Hoppas det blir klart.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page