Dear all,
I tried to do BULK INSERT / BCP of a table with a UDT column there.
The data file looks like this: (Tab, \n, second column is the UDT column)
9556987 C,C,0.84 4974588
9845355 C,C,0.84 4974588
9556988 A,C,0.82 4974589
9845356 A,C,0.82 4974589
9556989 A,T,0.90 4974590
This is the SQL:
BULK INSERT dbo.TEST
FROM 'E:\My Documents\Visual Studio 2005\Projects\Genotype\Genotype_UDT\BULK_in1.txt'
WITH
(
KEEPIDENTITY,
KEEPNULLS,
ROWS_PER_BATCH = 5,
TABLOCK
)
This is the error msg:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (GENOTYPE).
My UDT works fine if I do this:
INSERT INTO TEST VALUES('A,A,0.1101', 'Whatever')
Or INSERT INTO SELECT ...
So what's the problem?
Does SQL CLR engine call UDT Parse(...) for BULK INSERT? If not, must we provide the UDT value in binary like 0x11222ccffdedd, not a string?
I tried to do BULK INSERT / BCP of a table with a UDT column there.
The data file looks like this: (Tab, \n, second column is the UDT column)
9556987 C,C,0.84 4974588
9845355 C,C,0.84 4974588
9556988 A,C,0.82 4974589
9845356 A,C,0.82 4974589
9556989 A,T,0.90 4974590
This is the SQL:
BULK INSERT dbo.TEST
FROM 'E:\My Documents\Visual Studio 2005\Projects\Genotype\Genotype_UDT\BULK_in1.txt'
WITH
(
KEEPIDENTITY,
KEEPNULLS,
ROWS_PER_BATCH = 5,
TABLOCK
)
This is the error msg:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (GENOTYPE).
My UDT works fine if I do this:
INSERT INTO TEST VALUES('A,A,0.1101', 'Whatever')
Or INSERT INTO SELECT ...
So what's the problem?
Does SQL CLR engine call UDT Parse(...) for BULK INSERT? If not, must we provide the UDT value in binary like 0x11222ccffdedd, not a string?