On Sql Server 2008 you can save an image in a field with type image
or varbinary
.
I advice you to use varbinary
because image
is deprecated.
To save in this field you must write a procedure to launch an INSERT/UPDATE statement.
Question
I know it can be with a field 'image' on my table or the route something like 0x0002346sfh.. I rather to learn how to save the image with the route because I guess the database would be much faster that way, does anyone know the query to do this? Because I don't want to create a project in visual basic just to save a picture in my database I want to do this with a query if it's possible.
No correct solution
OTHER TIPS
On Sql Server 2008 you can save an image in a field with type image
or varbinary
.
I advice you to use varbinary
because image
is deprecated.
To save in this field you must write a procedure to launch an INSERT/UPDATE statement.
You can try something like this:
CREATE TABLE ImageTable (id int, [image] varbinary(max) )
INSERT INTO ImageTable ([image])
SELECT *
FROM OPENROWSET(BULK N'D:\Scenario1.jpg', SINGLE_BLOB) image;