BUG: BULK INSERT Fails While Inserting into an IMAGE ColumnID: Q197043
|
When you use BULK INSERT to insert large binary objects (BLOBs) into a SQL
Server Table with a column defined as an IMAGE datatype, the insert fails
with the following error:
Server: Msg 7399, Level 16, State 1, Line 0
OLE DB provider 'STREAM' reported an error. The provider did
not give any information about the error.
The statement has been terminated.
Use BULK INSERT and the WITH (FORMATFILE = '<file_name>') option. The
following steps will demonstrate this use.
D:\>dir *.bmp
Directory of D:\
11/21/98 10:04p 37,255 image_file.bmp
Note, that the length of this file is 37,255 bytes.
D:\>bcp pubs..image_table out d:\image_table.dat -Sjtknt0 -Usa -PUse these values:
Enter the file storage type of field c1 [image]:
Enter prefix-length of field c1 [4]: 0
Enter length of field c1 [0]: 37255
Enter field terminator [none]:
Do you want to save this format information in a file? [Y/n] y
Host filename [bcp.fmt]: image_table.fmt
Starting copy...
0 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.): total 1
use pubs
go
BULK INSERT pubs..image_table FROM 'd:\image_file.bmp'
WITH (FORMATFILE = 'd:\image_table.fmt')
go
select * from image_table
go
c1
------------------------------
0x310D0A320D0A330D0A[ASCII 133]
(1 row(s) affected)
Microsoft has confirmed this to be a problem in SQL Server version 7.0.
Additional query words: prodsql
Keywords : SSrvBCP SSrvTran_SQL kbbug7.00
Version : WINNT:7.0
Platform : winnt
Issue type : kbbug
Last Reviewed: April 16, 1999