Schedule a Stored Procedure To Email?

  • Hello,

    I believe this is possible but I need to export all (SELECT * ) data from one TABLE  and schedule an email to send every morning. Is this possible? I would like to create a stored procedure like

    CREATE PROC dbo.Customers

    AS

    SELECT *

    FROM tblCustomers

    I would like this sproc Customers run a DTS every morning and email it to user in Customer Service Dept. Can someone fill in the gaps please and let me know how to complete this task.

    Thanks In Advance,

    Lawrence

  • This was removed by the editor as SPAM

  • look at the bol for xp_sendmail. You have to have the email setup correctly on the server, but once this is done just pass you query into the xp_sendmail as the query parameter. SQL will send the result set of the query as part of the Email.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply