Up Prev Next
From: "Scott Zetlan" <scottzetlan at aol dot com>
Subject: RE: How to use BCP and Perl
Date: Sep 19 2002 1:28PM
Also see Sybase::BCP and Sybase::BLK, both of which will afford more control
and flexibility than Sybase's bcp utility. They are slower, though.
If you're wedded to the idea of using the bcp utility, you're probably
better off opening a pipe from the process than running it as a system call
and redirecting output to a file. Particularly for a long running bulk
copy, it is often helpful to be able to alert someone as soon as an error
occurs, rather than several hours later. Oftentimes those errors can be
corrected, and you only have to reload portions of your data stream.
> -----Original Message-----
> From: owner-SYBPERL-L@list.cren.net
> [mailto:owner-SYBPERL-L@list.cren.net]On Behalf Of
> Sent: Thursday, September 19, 2002 8:41 AM
> To: SybPerl Discussion List
> Subject: RE: How to use BCP and Perl
> > On Tue, 2002-09-17 at 12:53, Mark Sutfin wrote:
> > > To BCP data into an SQL Server db table, I have been using this code
> > > snippet:
> > > system 'bcp ccr_dev..personofferhistoryload in
> > > g:\agisdev\docs\currdev\11425\bcp_infile.txt -c -e
> > bcpload_fail.txt -h
> > > "ORDER (personid ASC)" -Uusername -Ppasswd -Sservername';
> > > I would like to capture some of BCP's messages, (e.g.
> > starting to copy, rows
> > > sent to server, packet size).
> > > I realize this is not a list for SQL Server, but any
> > direction would be much
> > > appreciated.
> > > SQL Server 2000
> Mark, the best (or at least most straightforward, if you're already using
> Sybperl) way would probably be to use MSSQL Perl by Erland
> Sommarskog, which
> can be found here:
> It's based on Sybperl (although it doesn't a support community
> like Sybperl;
> I've tried to convinced Erland to set up something, but he seems to prefer
> supporting on a case-by-case basis) so should be fairly easy for
> you to use
> (some of the calls are slightly different, so it's not just a simple
> changing of Use statements)...and yes, it supports BCP.
> Steve Wechsler/Application Manager/Wall St. Access
> "There is no reason anyone would want a computer in their home."
> -- Ken Olson, president, chairman and founder of DEC, 1977