I have table with definition:
I have image files near 80kb. When I am trying insert data to table Usluga like this:
INSERT [dbo].[Usluga] (Nazvanie, Cena_za_poseshenie, Image)
SELECT N'Персональный тренинг', 50, ThumbnailPhoto.*
FROM OPENROWSET
(BULK 'MyFilePathToImage.jpg', SINGLE_BLOB) ThumbnailPhoto
go
INSERT [dbo].[Usluga] (Nazvanie, Cena_za_poseshenie, Image)
SELECT N'Бокс', 90, ThumbnailPhoto.*
FROM OPENROWSET
(BULK 'MyFilePathToImage.jpg', SINGLE_BLOB) ThumbnailPhoto
go
I give error
String or binary data would be truncated. The statement has been terminated.
But varbinary(max) allows save data from 0 through 2^31-1 (2,147,483,647) bytes. How do I fix this?
Perhaps you're looking at the wrong column. Try resizing your nvarchar(20)
column so it can accept more than 20 characters.