Skip to Content.
Sympa Menu

freetds - Re: bcp api in db-lib progress.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: bcp api in db-lib progress.
  • Date: Thu, 29 Nov 2001 15:10:20 -0500


I do know that as of SQL Server 6.5 BCP worked the same way (by the way,
Sybases newer on-disk format is different too, and it seems that it still
works). BCP under TDS 7.0 has never worked to my knowledge, are you using
TDS 4.2 or 7.0?

In any event, most of my knowledge comes from the Sybase side of things,
so I'm afraid I'm not going to be much help here.

Brian

> Hi,
>
> I am trying to complete the programming on the bcp api in db-lib.
> My eventual aim is to create a bcp executable for UNIX that will talk to
> SQL server. I am having a go at filling in the gaps in the FreeTDS bcp
> implementation while I'm about it.
>
> After some experimentation and modification I have got it working for
> simple tables ( all fixed-length , not null columns ). However as soon as
> variable data is introduced (varchar or null columns for instance) it all
> goes pear-shaped.
>
> I worked out that the TDS "packet" for a row of data is essentially the
> physical representation of that row on disk within the server. I checked
> the code against an octal dump of a Sybase 11 data file, and confirmed
> this to be the case.
>
> Working on the basis that the SQL server representation of data must be
> subtly different, I looked at an octal dump of a SQL Server data file.
>
> Horror! The way that the variable columns of a row are represented in the
> file are totally different, and so far indecipherable.
>
> Does anyone have any idea what algorithm MS have used to represent this
> data ? I figure I have to work out what this before changing the code
> accordingly.
>
> Bill Thompson




Archive powered by MHonArc 2.6.24.

Top of Page