Skip to Content.
Sympa Menu

freetds - Re: [freetds] what's wrong with this freebcp statement?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <james.k.lowden AT alliancebernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] what's wrong with this freebcp statement?
  • Date: Wed, 15 Mar 2006 16:36:40 -0500

> From: blackwater dev
> Sent: Wednesday, March 15, 2006 2:13 PM
>
> I need to connect to a remove SQL server and grab all the data from
> a view. here is what I am using (of course I have changed names
> and ip addresses):
>
> freebcp databasename.viewname out data.sql -U username -P mypass
> -S 999.99.999.99:1433 -n
>
> I know the credentials are good because I can connect via php but
> when run, I get this:
>
> Msg 208, Level 16, State 1 Server 'MIRROR', Line 1
> Invalid object name 'databasename.viewname'.
> Msg 20018, Level 5 General SQL Server error: Check messages from
> the SQL Server.
>
> Error in dbnumcols
>
> What am I doing wrong?

Set up your freetds.conf correctly for your server. Be sure to use TDS
version 8.0 (or 7.0).

When you use "-S 999.99.999.99:1433", you bypass freetds.conf. FreeTDS
has to guess the protocol, meaning it falls back on its compiled-in
defaults. That default is probably TDS 4.2 (cf. "tsql -C"), which (as
mentioned in the freebcp manpage) is a no-no for BCP.

Also, don't use the "-n" option. You're going to load these data into
MySQL, yes? Then you probably want character data, a text file,
probably tab-delimited. Use "-c" instead.

HTH.

--jkl

-----------------------------------------
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
e-mail
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.




Archive powered by MHonArc 2.6.24.

Top of Page