Insert image into SQL Server
78,467
you can try like this
CREATE TABLE ImageTable
(
Id int,
Name varchar(50) ,
Photo varbinary(max)
)
INSERT INTO ImageTable (Id, Name, Photo)
SELECT 1, 'test', BulkColumn
FROM Openrowset( Bulk 'C:\test.jpg', Single_Blob) as image
Author by
mitsu
Updated on July 29, 2022Comments
-
mitsu almost 2 years
I want to insert in a table an
(image , id, Code)
but I don't know how to do this .What I am looking for is how to insert an image not url.
-
mitsu about 10 yearsbut if i put url of the image for exemple in my DD 'D' in a folder ' myimages' , and when the user take this application in the futur he will have a problem whith the path of the image no?
-
abdou_dev over 3 yearswhat if is stored procedure ? how can I do that?