How to store stored procedure result in excel file

  • Hi, i am new to sql server 2000. I have created a stored procedure and i want to store results in an excel file. any help will be appreciated. Thanks in advance.

  • There are several ways to store the output in excel.

    The two easiest are

    1. In query Analyzer set your Output to File and your ouput format to CSV (Tools->Options->Results will create a file you can open in Excel

    2. Even easier is to set the output to Text and output format to Tab then select your output and paste into an open excel worksheet.

    Other methods include writing an excel macro to connect to the SQL Server and execute the stored procedure - you can use the ADO connection, command and Recordset objects.

     

    Good luck

     

    S

  • Additionally you can use dts to call the stored procedure, and save as an excel file

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

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