Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Retrieve image with sql statement based on filename

I have a (sql server) database with a table containing logo files of companies. For a better performance only the filename is saved to the table (so it is not a BLOB field). All image files are in the same directory. For example the path is "e:\images" and the filename is in field strPictureLogo of tblCompany. Is it possible to build a sql statement that retrieves the image files, so that the view contains the images?
0
Sebina
Asked:
Sebina
  • 3
  • 2
  • 2
  • +1
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
i would say no...
0
 
lozzamooreCommented:
Do you mean you want the images or just the full path:
If the latter:


select 'e:\images\' + strpicturelogo as logopath
from tblcompany

Cheers.
0
 
SebinaAuthor Commented:
I do not mean the full path! I would like to have the image in a view as if the image was in the database.
0
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I know that Access has this feature, but SQL Server doesn't ...
0
 
lozzamooreCommented:
I agree with Angelll
Out interest, what client do you want to run this SQL/view from?
0
 
SebinaAuthor Commented:
I want the images to appear on a Crystal Report which is opened from ASP (in a web application).
Since it is not possible to change the path of an image when opening the Crystal Report from ASP (though this is possible from a VB application) I need the images to be included in a view.

Thanks for your comments.
0
 
niklausjCommented:
in sql 2000 you could write a UDF to pull the File into a temporary blob in sql and include it into a view, but that'll give you a performance far below any blob field natively in the db.
But depending on your needs you can speed up blob stuff if you insert the blobs in a separate table in a different filegroup that you can have in a different file on a different drive.
( Go to DB Properties, Add a DataFile give it a Different FileGroupName, then create table (ID int, Blob image ) on yourFileGroup to send the table to this file)
0
 
SebinaAuthor Commented:
So it just seems not possible to add pictures to a view without having the pictures in a (temporary) table. I now have simply saved the pictures to a table directly. Thanks for your help.

Sebina
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now