SQL 2005
Hi All,
I am importing a text file with the following code:
It works fine, apart for 2 columns that are Boolean (bit) type.
The text file has the data for these 2 columns as 'True'\'False'.
If I change these 2 columns type to varchar (10), it imports no problem and for these columns it shows the actual words 'True'\'False'.
If however I have the type for these 2 columns as bit, it does not import and gives a:
"Bulk load data conversion error (type mismatch or invalid character for the specified codepage)" error message.
I have tried to look for info, but can't find if there is a certain procedure to import booleans as '1'/'0'?
Any info appreciated.
Thank you
Michael
Hi All,
I am importing a text file with the following code:
Code:
BULK INSERT tblname
FROM 'd:\data.txt'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
It works fine, apart for 2 columns that are Boolean (bit) type.
The text file has the data for these 2 columns as 'True'\'False'.
If I change these 2 columns type to varchar (10), it imports no problem and for these columns it shows the actual words 'True'\'False'.
If however I have the type for these 2 columns as bit, it does not import and gives a:
"Bulk load data conversion error (type mismatch or invalid character for the specified codepage)" error message.
I have tried to look for info, but can't find if there is a certain procedure to import booleans as '1'/'0'?
Any info appreciated.
Thank you
Michael