samprg
asked on
Insert Image
Hi,
I have column (binary) in KPIimg table, I need to insert image into KPIimg
Insert [KPIimg] (rate,[img])
Values (1,(Select * from Openrowset( Bulk 'D:\PIC\green.jpg', Single_Blob) as KPI))
I got error:
Msg 8152, Level 16, State 10, Line 1
String or binary data would be truncated.
The statement has been terminated.
I have column (binary) in KPIimg table, I need to insert image into KPIimg
Insert [KPIimg] (rate,[img])
Values (1,(Select * from Openrowset( Bulk 'D:\PIC\green.jpg', Single_Blob) as KPI))
I got error:
Msg 8152, Level 16, State 10, Line 1
String or binary data would be truncated.
The statement has been terminated.
ASKER
I get same error, I am useing sql 2012
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent, it was binary(50)
INSERT INTO [KPIimg] (rate,[img])
SELECT 1, BulkColumn
FROM Openrowset( Bulk 'D:\PIC\green.jpg', Single_Blob) as KPI