'SET ANSI_WARNINGS OFF' on SQL Server

"Gouda, Ravajappa" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
The SET ANSI_WARNINGS OFF on SQL Server, among other things, it replaces null values with 'blank' character. It works with BULK-INSERT and INSERT statement on SQL Server.

 

However, with freebcp I expected it to work with -O option as provided in the example below. It does not seem to work, please advise?

 

 

I tried with and without format files, tds version 7.0 and 8.0. The database server is SQL Server 2005. I am using freebcp version 0.82 on Linux.

 

Version information:

$ /efs/dist/fsf/freetds/0.82-ml02/exec/bin/freebcp -v

usage:  freebcp [[database_name.]owner.]table_name {in | out} datafile

        [-m maxerrors] [-f formatfile] [-e errfile]

        [-F firstrow] [-L lastrow] [-b batchsize]

        [-n] [-c] [-t field_terminator] [-r row_terminator]

        [-U username] [-P password] [-I interfaces_file] [-S server]

        [-v] [-d] [-h "hint [,...]" [-O "set connection_option on|off, ...]"

        [-A packet size] [-T text or image size] [-E]

 

BCP Command:

freebcp dbname..tbname in /tmp/bcpFile.dat -O 'set ansi_warnings off' -S SQL_SERVER_NAME -U myself -P secret -c -t\|

 

 

Further details -

Here is the test table 

create table test_table (

  col1 varchar(2) not null,   

      col2 char(5) null,

      col3 varchar(10) null

)

 

More bcpFile.dat

a|b|c

|b|c                       ß First column is null should be padded with a blank character when inserted into test_table. But that is not the case, can someone help?

 

Thanks,

Gouda

----------------------------------------------------------------------
This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. 

References to "Sender" are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.