1

I have a table students that contains 100 Records.

Now i'm going to Run a Query

select * from Students

I Copy the Students Data and Paste it in My Excel File

After some Time i inserted another 100 Records now again i'm going to run the Query copy the Data and Paste it in Excel File

Every Time copied and Paste in Excel File.

Is there any Alternate way or Query that directly save the Data in my Excel File

1 Answers1

1

Simplest way would be accessing database table by creating a data connection from excel. I assume you are using Sql server database.

  1. In Excel go to the Data tab
  2. Select relevant data source in the "From Other Sources" drop down
  3. Select Sql server and give necessary conection information and select the table you wanted while navigating through.
  4. Select "Table" as prefered view option and it will show the table in excel.
  5. When a change happen in the database simply right click the excel table and Refresh it
Chamal
  • 1,439
  • 10
  • 15
  • It's good but if i have a condition in my Query then what should i do...? – user2618074 Sep 04 '13 at 11:15
  • There is an option in the "From Other Sources" drop down as "From Microsoft Query". Using that option you can build query using query wizard. – Chamal Sep 04 '13 at 13:13