Skip to Content.
Sympa Menu

freetds - [freetds] patch for new application program

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] patch for new application program
  • Date: Mon, 15 Nov 2004 16:58:24 -0000

Hi All,

I posted a patch to source forge last week.

This patch includes a new application program - datacopy - which a
couple of people have expressed an interest in recently.
This program allows the user to move a table of data from one server to
another without the need for bcp-ing the data out and in.
In so doing, it bypasses the need for intermediate data files, and is
also faster, as it bypasses the need to convert data to and from
character format.

I have used the program extensively to migrate data from Sybase to SQL
server, and vice versa, but it could have a variety of uses.

I needed to make a few small changes to db-library to allow this program
to work.
A couple were small and (probably undetected) bugs in existing functions
- dbcolinfo() primarily - but I also added a new dblibrary function -
dbtablecolinfo() - to allow me to accurately describe a table without
resorting to accessing TDS layer data.

I have also included a manual page, as follows:

NAME
datacopy - move table data between two servers
SYNOPSIS
datacopy [-t | -a | -c owner] [-b batchsize] [-p packetsize] [-v] [-d]
[-S server/username/password/database/table|view]
[-D server/username/password/database/table]

DESCRIPTION
datacopy is a utility program distributed with FreeTDS.
datacopy will move table data from one server to another, without
the need for intermediate files. Using datacopy will be much faster
and more efficient than using freebcp out/in.

datacopy makes use of the dblib bcp api built into FreeTDS. This
api is also available to application developers.

datacopy can be used to migrate data between Sybase ASE and SQL Server
or vice versa.

OPTIONS
-t truncate target table before loading data

-a append data to target table

-c owner create the target table with the same schema as the
source
table. datacopy will submit a 'create table' command on
the target server/database using the specified owner in
the command, e.g. create table owner.table (...

-b batchsize is the number of rows per batch of data copied.
Each batch of data is effectively 'committed'
into the database. the default value for batchsize is
1000.

-p packetsize Specifies the number of bytes, per network packet, sent
to
and from the server(s). Increased packet size can
enhance
performance.

-v produce verbose output, including diagnostic timings.

-d produce freetds TDSDUMP output (serious debug only!)

-S ... specifies the connection information for the source
server
and the location/name of the table (or view) to be
copied.
The argument to the -S option is in the format:

server/username/password/database/table|view

If the -S option is not specified, datacopy will prompt
the
user to enter this data.

-D ... specifies the connection information for the destination
server
and the location/name of the target table.
The argument to the -D option is in the format:

server/username/password/database/table

If the -D option is not specified, datacopy will prompt
the
user to enter this data.

HISTORY
datacopy first appeared in FreeTDS 0\.63

AUTHORS
The datacopy utility was written by Bill Thompson
(thompbil AT exchange.uk.ml.com)
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------





Archive powered by MHonArc 2.6.24.

Top of Page