July 21, 2010 at 7:44 pm
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?
July 21, 2010 at 8:50 pm
If you're using SSIS to export you can write the query when asked Copy table or Write Query.
July 21, 2010 at 8:58 pm
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.
July 23, 2010 at 9:29 am
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