Results 1 to 2 of 2

Thread: Extracting Data from SQL Server into a Spreadsheet

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Extracting Data from SQL Server into a Spreadsheet

    I am trying to extract about 5 records from a SQL Server table into a spreadsheet. Basically, I want a snapshot of a table showing it's field names and it's associated field values. I wish to be able to print out this data. What is the best way to do this?

    Thanks,

    Blake

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Extracting Data from SQL Server into a Spreadsheet

    open excel (blank sheet)
    open a recordset of the data you want
    loop through the field names and output to row 1, columns whichever
    loop through records and put into cells under the columns
    close recordset

    Something like that.
    Excel will allow you to record macros to look at. You can either use a reference or just create an object for the excel object.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width