Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeBCP to SQL Azure complains table is missing?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Cade Roux <cade AT roux.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeBCP to SQL Azure complains table is missing?
  • Date: Tue, 20 Nov 2012 21:04:39 -0600

Yes, that user's default database is probably master. There IS a
default database set up in the odbc config, but I was mistaken, there
is no such option in the freeetds.conf.

We've moved away from trying to get Linux to work for this process for
now, but I'll revisit this.

I expect that workaround will not work because USE isn't supported -
you do in fact have to connect directly to the database, because of
the nature of the SQL Azure architecture.

Cade
Cade Roux
cade AT roux.org
504-717-4887


On Tue, Nov 20, 2012 at 8:51 PM, James K. Lowden <jklowden AT freetds.org> wrote:
> On Sun, 18 Nov 2012 20:16:59 -0600
> Cade Roux <cade AT roux.org> wrote:
>
>> Has anyone used FreeBCP to connect to SQL Azure?
>>
>> $ freebcp DWSTAGE.BCPTEST in bcptest.txt -f cdr.fmt -S
>> serverfromfreetds -U user@azureserver -P password
>> Msg 208, Level 16, State 1
>> Server 'azureserver', Line 1
>> Invalid object name 'DWSTAGE.BCPTEST'.
>> Msg 208, Level 16
>> General SQL Server error: Check messages from the SQL Server
>
> The message 208 comes from the server. A quick look at freebcp.c shows
> argv[1] isn't parsed. It's copied to a struct and used verbatim e.g.
>
> if (dbfcmd(dbproc, "SET FMTONLY ON select *
> from %s SET FMTONLY OFF", pdata->dbobject) == FAIL)
>
> My guess is that the account you're logging in with has a default
> database, and that database is not the one containing DWSTAGE.BCPTEST.
> The Azure server rejects dbname.schema.object syntax, and freebcp has
> no -D option because until Azure every TDS server did accept that
> syntax.
>
> You could verify that using
>
> $ freebcp 'select db_name()' queryout /dev/stdout ...
>
> As a temporary workaround, I think this would work:
>
> freebcp DWSTAGE.BCPTEST in bcptest.txt \
> -O 'USE dbname' \
> -f cdr.fmt -S serverfromfreetds -U user@azureserver -P password
>
> A permanent fix would support -D.
>
> HTH.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page