Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / SQL

How to Copy SQL Table Into Excel and Other Formats

3.67/5 (5 votes)
10 Jul 2013CPOL 24.4K  
How to copy SQL table into Excel and other formats

Introduction

This post shows you how to take SQL table into Excel and other formats.

  1. Open ssms2012->databases->sample database.

    Image 1

  2. Click that export data. There is a new window open as shown below:.

    Image 2

  3. Choose the datasource, there are a lot of datasources dropdowns here:

    Image 3

  4. Choose the source database, here  dbo.sample is a source database.

    Image 4

  5. Here, you choose designation Database or other formats like oldb, excel formats.

    Image 5

  6. Then Excel file path.

    Image 6

  7. Select the first radio button for copy or second radio button for query to write the data, choose any one.

    Image 7

  8. Click next->select table you want to copy:

    Image 8

  9. If you want edit the columns means you have to use this window editmapping.

    Image 9

  10. You can check the preview for here:

    Image 10

  11. Click next.

    Image 11

  12. Finish.

    Image 12

  13. After you click finish, you can see files can be transferred like below:

    Image 13

  14. Go to->myDocuments, open the Excel file that you already created and all data comes to Excel sheet. That’s all.

    Image 14

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)