Question
In SQL Server 2005, I have a table with images (data type: image). How to use only SQL, how to save the image as a file (on the same server as SQL Server). If I need, I will use the SQL CLR, but I want to avoid this if possible.
Background
I want the SQL Server job to not execute the schedule that proc calls, which will send emails with embedded images using SQL Server Database Mail as follows:
exec msdb.dbo.sp_send_dbmail @profile_name = 'MyProfile', @recipients = 'bob@hotmail.com', @subject = 'hello', @file_attachments = 'C:\MyLogo.gif', @body=N'<p>Image Test</p><img src="MyLogo.gif" /><p>See image there?</p>', @body_format = 'HTML';
This SQL works, but I need to save the image as a file first. If I can get the image directly to an email inbox without saving it as a file, thatβs fine, but I need to embed it in email, and I want to use only SQL.
sql email sql-server image
Craig HB
source share