SQL - EMail file from queries

Last Post 28 Dec 2004 12:43 PM by kohli290866. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
lynneroberts
New Member
New Member

--
19 Nov 2004 12:40 AM
Does anyone know about this?

I am developing a database MS Access frontend with SQL Backend, using stored procedures on SQL Server 2000.

What I want to do is email an attachment that includes data generated from a stored procedure to the customer that the database record that has been generated using MS Outlook.

I have tried xp_sendmail and setting the attachment variable to True, however this only sends a Txt file and the formatting within this is not good. I want the same functionality but using an excel spreadsheet or html file.

I have also looked at the sp_createwebtask function but in practice it doesn't do want we want under the permissions because the logged on user needs to be a member of the sysadmin group. Have tried using the sp_runwebtask after defining the requirements in sp_createwebtask but that would then over the file and then we can't keep a record of the emails and files that have been sent.

Any other ideas?
lynneroberts
New Member
New Member

--
19 Nov 2004 05:37 AM
THanks Monte ... I had thought about it however we were trying to not use the client per se, and have it generated by the server itself. Reason being is we will be upgrading in the next few months (Platform and software versions) and we didn't want to encounter possible problems with it falling over in the future after the upgrade, we felt if we could do it via SQL it would prevent re-work in the future.
Since posting I've still been searching the help files and other internet help sites and I don't think SQL possesses the functionality that I want so will no doubt have to go down the route similar to what you have suggested.

Thanks again for your advice
kohli290866
New Member
New Member

--
28 Dec 2004 12:43 PM
In my opinion, using the SQL MAIL object in DTS to send the file
of your choice/format would be much better and of course more
reliable then xp_sendmail.

Thanks.


Acceptable Use Policy
---