Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Excel VBA to import into SQL Server 2008

Author  Topic 

Biz1705
Starting Member

8 Posts

Posted - 2010-08-11 : 22:38:29
Hi,

I am new to using Excel VBA to import into SQL Server 2008.

Currently I have 17 files to upload up to 1000 rows manually. Is there a VBA that can load an excel file directly into SQL?
It would be faster then loading 1 file at time in SQL import.

I was thinking having named range and having SharePoint addresses of xlsm /xlsx files and looping it through.

Any suggestions would be greatly appreciated.

Biz

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-08-12 : 09:13:58
How much data is in each excel file
If they are simple excel files that need to be loaded
I would copy all the 17 excel files into differant sheets of 1 excel file and use the import option

Iam not sure if you are trying to load 17 of the excel files to one table?

Thanks
Go to Top of Page

Biz1705
Starting Member

8 Posts

Posted - 2010-08-12 : 18:56:25
Hi,

I have 14 files with 495 rows and 2 1000-1500 rows.

I am trying to load it table and then I have SQL script to transform data to other DBs.

Need Excel VBA code to upload 17 files in loop so no manual imports to SQL.

Biz
Go to Top of Page

shafiq
Starting Member

3 Posts

Posted - 2011-05-12 : 11:31:17
Hello All,

I got somewhat same situation. On daily basis, 10 excel files get stored in a folder (all files contains same format). I want to upload its data to SQL Server through VBA.

I know this can be done by openrowset or openquery of sql server BUT the excel file contains one vba code which does calculations and bring data in a desired table format which need to be uploaded to sql server.

First plan, some way trigger this excel vba code from sql server - this would be great!!!

Second plan, run vba code from excel file itself.
Then upload result data to sql server through vba only ---need vba code for this.

I would greatly appreciate all your advice and help. Thanks.
Go to Top of Page
   

- Advertisement -