How do you save the results to a HTML file from a scheduled query in SQL Server Agent

  • Hello,

    How do you save the results to a HTML file from a scheduled query in SQL Server Agent in SQL 2005?

    I have a scheduled job that does a simple query; the job runs once a day all it does is:

    SELECT * FROM table1.defects

    I am trying to figure out how to save the results to a HTML file on local drive c:. I have looked in Books Online, and have searched the web but have not seen anything that can be done through a query in SQL Server Agent.

    My guess is I am going about this totally wrong. Can someone please suggest what I should be using.

    Thank you.

  • Conversion to html format usually is done by a frontend application.

    What you could look into is XQuery to save the data in XML format.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Here is a thought - create a report in Reporting Services. Schedule the report to be run and delivered every day by email in HTML format.

    You can either have that included as an attachment, or embedded in the email. If it just has to be created in a folder, that can be done also.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • thank you, I will give Report Server a go.

  • Well - You can use SQLCMD command line utility and pipe the results to a File. ;-). Might be easier

Viewing 5 posts - 1 through 4 (of 4 total)

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