Save and Send xml file automatically from stored procedure

Posted on 2009-02-23
Last Modified: 2012-05-06

I have a stored procedure which returns xml using FOR XML AUTO, ELEMENTS.
What I need to do now is:
1. schedule a task once a day that will run the stored procedure and save the xml results to an xml file .
2. send the file by email.
How do I do this?

Question by:ggilal
    LVL 37

    Expert Comment

    you can write a c# stored procedure that perform the above actions
    then you can schedule that procedure using a sql server job to run on a daily basis

    Author Comment

    I need more details please.
    Any code would be very helpful. Thanks!
    LVL 37

    Accepted Solution


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now