I need to read the image from the specific path. I pass only path as parameter and that image will return by the procedures in image or byte format.
+1
A:
Take appropriate SQL injection precautions.
EXEC('SELECT image_data
FROM OPENROWSET(
BULK N''' + @Path + ''',
SINGLE_BLOB)
AS ImageSource(image_data);')
Martin Smith
2010-10-01 12:36:16
it is not working give me error like this -- Cannot bulk load. The file "C:\1.jpg" does not exist.
KuldipMCA
2010-10-01 13:29:30
The file needs to exist **on the server** (or network share visible to the server) and in a place that the SQL Server account has permissions to read.
Martin Smith
2010-10-01 13:58:15