question

jonhsontim8 avatar image
jonhsontim8 asked

export data from sql server to excel

Hello, I faced with an issue: there is a need to export data from SQL Server to excel. Can you help me? How to do this? I'm on SQL Server 2008 R2
sql server 2008
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
There are a multitude of ways to accomplish this. 1. You can use SSIS to manually create an ETL process. https://www.youtube.com/watch?v=CJI6pPueyzM 2. You can right click the database and select Tasks --> Export Data. This will generate an SSIS package for you through the UI. You can save this package to re-use for later. 3. You can use BCP and export the data to a CSV, which can then be opened in Excel. ( https://msdn.microsoft.com/en-us/library/aa337544.aspx) 4. You can use Powershell. http://www.maxtblog.com/2014/06/powershell-extracting-sql-server-data-into-excel/ Do you have any other requirements than just "exporting data"? Hope some of those will help!
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jonhsontim8 avatar image jonhsontim8 commented ·
Thanks JohnM for reply. I need to export data from .bak file
0 Likes 0 ·
David Wimbush avatar image David Wimbush jonhsontim8 commented ·
A .bak file is a backup file. I trust you know you'll need to restore that as a database before you can get at the data? It would be easier to get the data from the database that was backed up to the .bak file if you can.
1 Like 1 ·
jonhsontim8 avatar image jonhsontim8 jonhsontim8 commented ·
Thanks a lot David
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.