Tags: control, document, excel, output, proc, programming, queries, series, sql, ss2000, standard, stored, worksheets

output to excel from stored proc

On Programmer » SQL

5,225 words with 3 Comments; publish: Thu, 29 May 2008 04:27:00 GMT; (200140.63, « »)

Using SS2000 Standard. I need to output the results of a series of queries to different worksheets in an Excel document. I need to have some control over where the data goes in the spreadsheet. I worked a little bit with the Excel objects and Access. Is there anything built in to SS to do this

Thanks

Dan D.

All Comments

Leave a comment...

  • 3 Comments
    • IMHO, you should write VBA code in Excel or maybe VB or VBScript that pulls

      the data from the stored procedure.

      SQL Server doesn't know anything about Excel, except the things you might be

      able to do with DTS...

      --

      http://www.aspfaq.com/

      (Reverse address to reply.)

      "Dan D." <anonymous.sql.questionfor.info.discussions.microsoft.com> wrote in message

      news:D716C992-A0C1-4C15-A170-9FF368EFD11A.sql.questionfor.info.microsoft.com...

      > Using SS2000 Standard. I need to output the results of a series of queries

      to different worksheets in an Excel document. I need to have some control

      over where the data goes in the spreadsheet. I worked a little bit with the

      Excel objects and Access. Is there anything built in to SS to do this?

      > Thanks,

      > Dan D.

      #1; Thu, 29 May 2008 04:28:00 GMT
    • Aaron,

      I have to do a before and after report on some tables. I have a set of queries that I run before I start a process. Right now I copy and paste the results into Excel. After getting the "before" results, I run the process then I want to run the same queries again and I copy and paste the results into Excel. I'm trying to automate this process. I was hoping to do all of this in a sp.

      Since SQL Server doesn't know about the Excel objects can you think of any other way to get these before and after results into Excel from a sp? If not, I know I can do it in a dts. It's just a bit cumbersome.

      Thanks,

      Dan D.

      "Aaron [SQL Server MVP]" wrote:

      > IMHO, you should write VBA code in Excel or maybe VB or VBScript that pulls

      > the data from the stored procedure.

      > SQL Server doesn't know anything about Excel, except the things you might be

      > able to do with DTS...

      > --

      > http://www.aspfaq.com/

      > (Reverse address to reply.)

      >

      >

      > "Dan D." <anonymous.sql.questionfor.info.discussions.microsoft.com> wrote in message

      > news:D716C992-A0C1-4C15-A170-9FF368EFD11A.sql.questionfor.info.microsoft.com...

      > > Using SS2000 Standard. I need to output the results of a series of queries

      > to different worksheets in an Excel document. I need to have some control

      > over where the data goes in the spreadsheet. I worked a little bit with the

      > Excel objects and Access. Is there anything built in to SS to do this?

      > >

      > > Thanks,

      > >

      > > Dan D.

      >

      >

      #2; Thu, 29 May 2008 04:29:00 GMT
    • You could send it to CSV much easier than to Excel directly.

      And you *can* do this quite easily by using ASP, or VBS, or VB, ... you

      might have to run the script twice, and import two separate CSV files...

      http://www.aspfaq.com/2482

      --

      http://www.aspfaq.com/

      (Reverse address to reply.)

      "Dan D." <Dan D..sql.questionfor.info.discussions.microsoft.com> wrote in message

      news:D9DB7002-527B-460C-AC9C-FAF27A40C1D8.sql.questionfor.info.microsoft.com...

      > Aaron,

      > I have to do a before and after report on some tables. I have a set of

      queries that I run before I start a process. Right now I copy and paste the

      results into Excel. After getting the "before" results, I run the process

      then I want to run the same queries again and I copy and paste the results

      into Excel. I'm trying to automate this process. I was hoping to do all of

      this in a sp.

      > Since SQL Server doesn't know about the Excel objects can you think of any

      other way to get these before and after results into Excel from a sp? If

      not, I know I can do it in a dts. It's just a bit cumbersome.

      > Thanks,

      > Dan D.

      > "Aaron [SQL Server MVP]" wrote:

      > > IMHO, you should write VBA code in Excel or maybe VB or VBScript that

      pulls

      > > the data from the stored procedure.

      > >

      > > SQL Server doesn't know anything about Excel, except the things you

      might be

      > > able to do with DTS...

      > >

      > > --

      > > http://www.aspfaq.com/

      > > (Reverse address to reply.)

      > >

      > >

      > >

      > >

      > > "Dan D." <anonymous.sql.questionfor.info.discussions.microsoft.com> wrote in message

      > > news:D716C992-A0C1-4C15-A170-9FF368EFD11A.sql.questionfor.info.microsoft.com...

      > > > Using SS2000 Standard. I need to output the results of a series of

      queries

      > > to different worksheets in an Excel document. I need to have some

      control

      > > over where the data goes in the spreadsheet. I worked a little bit with

      the

      > > Excel objects and Access. Is there anything built in to SS to do this?

      > > >

      > > > Thanks,

      > > >

      > > > Dan D.

      > >

      > >

      > >

      #3; Thu, 29 May 2008 04:30:00 GMT