Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 BCP import bit problem

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2002-11-07 : 19:27:31
10 SQLBIT 0 1 "," 10 ISSO ""

The line above is a bcp.fmt description of a BIT datatype. BCP imports from A CSV file and all values for the 'ISSO' column are ascii character 0 or 1.

BCP imports into the ISSO column only the value '1' even if 0 is specified in the data file.

Is this a problem with my BCP format specification?

Sam

SamC
White Water Yakist

3467 Posts

Posted - 2002-11-08 : 09:58:13
I've surrendered on Bit datatype, now I'm trying INT.

BCP copys the character '0' as int value 48 into the table.

Anyone know what option I need to set to fix this? I'd like characters '0' and '1' translated to values 0 and 1.

Sam

Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2002-11-08 : 16:20:35
I finally settled on importing all the data as type char.

I do the conversion using CAST in a procedure.

Works great.

Sam

Go to Top of Page
   

- Advertisement -