2012年3月8日星期四

BCP exporting data, what's t

Hi
You may want to post DDL and sample data for this so it can be re-produced.
If you try bcp with the format option, does the format file differ to the
one you have?
John
"Scott A. Keen" wrote:

> I'm using BCP to export data.
> When I look at the data with Notepad, some empty fields have this "?"
> character, but this character does not appear in the database table.
> This is apparently causing problems with the company we're exchange data
> with. They are asking for the field to be empty, not to contain this "?"
> character.
> What can I do to make sure the field is blank instead of containing this "
?"
> character? Is this a character set issue? How do I correct this?
> Thanks,
> Scott
>
> For your reference, I've set up a format file which looks like this...
> 8.0
> 55
> 1 SQLCHAR 0 36 "|" 1 Order_GUID SQL_Latin1_General_Cp437_BIN
> ...snip...
> 54 SQLCHAR 0 50 "|" 54 PlaceReceipt SQL_Latin1_General_Cp437_BIN
> 55 SQLCHAR 0 50 "\r\n" 55 container_SealNumber SQL_Latin1_General_Cp437_BI
N
>
>We have a UNIX system that exports that character when a blank field should
be returned. That strange character typically represents a place holder for
the table / field DB structure. On the UNIX system we have it uses Informix
as its DB and informix uses the ? to repersent a blank field. Thus, when I
import into MS SQL the character gets loaded into the table.
When exporting the data, I have got around this by using the replace
command, replace(Field, '?','') to get the blank field, but I do not know i
f
you can do this with bcp, I typically use dts.
-David
"John Bell" wrote:
> Hi
> You may want to post DDL and sample data for this so it can be re-produced
.
> If you try bcp with the format option, does the format file differ to the
> one you have?
> John
> "Scott A. Keen" wrote:
>

没有评论:

发表评论