[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

loading data into a BIT column using bcp api

vivek

3/28/2007 8:58:00 AM

HI,

i have trouble understanding the bcp api behaviour in the following scenario:

- my table has a BIT column
- i use bcp api to send data
- i bind the program variable as SQLINT2 (as that is the nature of the data)
- the input data ranges from 1 to 10
- on running this program i get an error "Numeric value out of range" for
the rows 2 to 10
- However i can insert the same values from tsql

My question is why isn't the conversion happening (as for BIT type any
non-zero value is supposed to be treated as 1) ?
If i bind the program variable as SQLBIT iam able to insert the values. Now
the bcp_bind definiton says that it expects the C data type of the program
variable and the data would be converted to that of the database column. Now
why should i pass SQLBIT, passing SQLINT2 should work as well.

Can someone please clarify ?