Export Data from SQL to Excel

  • I have little over 100,000 records in a table and I'd like to be able to export data from SQL to Excel. It does not have to be in a single file. Is there a way to select first 60,000 record using a query and then extract remainder of records?

  • If you're using SSIS to export you can write the query when asked Copy table or Write Query.

  • If you will be using SSRS then this info might help

    How to: Add a Page Break (Reporting Services)

    http://technet.microsoft.com/en-us/library/ms156434.aspx

    If above is not satisfactory .. please post asking for additional assistance, specifying what you will be using for the export.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Why not just use bcp? Its easy to do.. Open a command (the black dos type window) window and run the command..

    bcp <yourdb>.<yourschema>.<yourtable> out <filename> -c -t, -T -S<servername> -F<firstrow> -L<lastrow>

    Heres an example of pulling 100 records from a table in a test database of mine..

    bcp hookDB.dbo.hook_ctrhistory out c:\ctrhistory.csv -c -t, -T -Slocalhost -F1 -L100

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

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

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