ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to import SQL databases automatically / by batch? (https://www.excelbanter.com/excel-discussion-misc-queries/238707-how-import-sql-databases-automatically-batch.html)

Simon Kwong

How to import SQL databases automatically / by batch?
 
Hi,

I have 20-30 SQL database files. How can I to import the data into Excel
files automatically or by batch (using macros)?

Thanks
Simon


joel

How to import SQL databases automatically / by batch?
 
There are a few method. The easiest to set up is to perform a query fro the
worksheet menu Data - Import External Data - New Databae Query.

the second metho is to use a macro to open the database a retrieve the data
using SQL. You can actually get the SQL statements by recording a macro when
you do an New Database Query. If you record the macro while performing a New
Database query the Command Text portion of the recorded macro is the SQL
statments.

If yo need help record the macro and post the rrecorded macro for additional
assitance.

"Simon Kwong" wrote:

Hi,

I have 20-30 SQL database files. How can I to import the data into Excel
files automatically or by batch (using macros)?

Thanks
Simon



All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com