I currently have a SQL Server 2005 database that sends HTML emails to various users, and I take advantage of the @file_attachments
parameter to embed images in the email. I have the image files on the SQL Server itself, so the parameter refer to the absolute path of the images on the server.
We're now moving to SQL Server 2008 R2, which is nice, but the new server structure is locked down so I can't just drop image files on the server and point the @file_attachments
parameter at them.
I'm looking at two possible solutions:
Store the images in a database column of type
VARBINARY(MAX)
orIMAGE
, and somehow point the@file_attachments
parameter at that. I don't see any way to do this, though.Use
VARBINARY(MAX)
withFILESTREAM
and figure out the physical path to the file on the database server. Not sure if this is possible, but I suspect it is.
Has anybody tried this? Any other suggestions?
Thanks, Jim