[freetds] bcp timestamp trace

Lowden, James K LowdenJK at bernstein.com
Tue Apr 13 12:03:36 EDT 2004


> From: Frediano Ziglio [mailto:freddyz77 at tin.it]
> Sent: April 13, 2004 11:25 AM
> Il mar, 2004-04-13 alle 14:49, Thompson, Bill D (London) ha scritto:
> > 
> > 1) identity columns. 
...
> 
> I don't understand why we should need a trace here... first thing that
> bcp does is check sql table definition. At this point bcp knows source
> columns and destination columns. 

Actually no, or not always.  Sure we have the table metadata, but the file is oftentimes just a file.  All we know is that the file needs to have N columns, based on the table metadata.  

If we have a bcp.fmt file, we can map the columns.  I don't know, but I assume the "insert bulk" statement is analogous to INSERT: we name in parentheses the columns we're inserting.  I think that's part of Bill's purpose in examining the traces.  

We know that we have some issue:
> - source column is not in destination. Discard?

Cannot map.  Error.  

> - there is no corresponding column in source. 

Again, error.  If a field is delimited but empty, -k logic applies.  

We should not guess.  The user may have intended something else.  His instructions should be explicit and unambiguous.  

> - destination is not writable:
>  - computed. Do not import

AFAIK, it's impossible to distinguish computed columns from regular ones based on their metadata.  Microsoft's bcp.exe does not support loading tables with computed columns.  I think the server will return an error if we try.  

>  - identity. Omit or use IDENTITY_INSERT and insert it

Probably.  Or send NULL?  Trace will tell.  

>  - timestamp. I don't think is possible to bypass and insert 
> this column so omit from INSERT BULK, server will fill data.

Exactly.  

--jkl


-----------------------------------------
The information contained in this transmission may contain privileged and confidential information 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.





More information about the FreeTDS mailing list