Skip to Content.
Sympa Menu

freetds - RE: [freetds] bcp timestamp trace

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] bcp timestamp trace
  • Date: Tue, 6 Apr 2004 10:04:13 +0200

>
> Attached for future reference is a perfect tcpdump trace of a
> short session using BCP.EXE to load four rows into a
> Microsoft SQL Server 7.0 table.
>
> Notes:
>
> 1. To get the metadata, does:
> SET FMTONLY ON
> select * from dbname..tablename
> SET FMTONLY OFF
> Might be more efficient than "where 0=1".
>
> 2. "insert bulk dbname..tablename (ts int)".
>
> The DDL for the table:
>
> CREATE TABLE ts (ts int, cc timestamp)
>
> So (in contradiction to comments I just committed), the
> timestamp column is simply omitted from the query. I guess
> the server does the magic.
>

Interesting.
About comment in bcp

/**
* \todo support timestamp columns.
* Things we know:
* 1. usertype is 80 (0x50)
* 2. server type is 183 (0xAD)
* 3. Microsoft bcp.exe (TDS 7.0) uses SQL type "INT" in the bulk
insert statement.
* 4. Library must send null; server sets timestamp on receipt.
* 5. FreeTDS will send null if data_size = -1.
* 6. Something is munging the server type from 183 to 179.
*/

2 it's binary (in this case XSYBBINARY, Sybase send SYBBINARY)
3,4 this is false, table was CREATE TABLE ts (ts int, cc timestamp), bcp
just to not send timestamp column (filled by server)
6 I don't understand...

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page