Multiple Excel files are quickly imported into the DB

Source: Internet
Author: User

1. File more, you need to import so much data into the DB, a import is too slow, can think of the first data into an Excel, and then import

2. The first step is to prepare to merge Excel, create a new Excel, named Totaldata.xlsx, remember that the excel2016 version does not support xlsx import, only the XLS selection, so the above suffix name unified to. xls

3. Double hit Open totaldata.xlsx,alt+f11, quickly open the editor, double-click "Sheet1", enter the following script

Sub Workbook sheet merge () Dim Fileopendim X as integerapplication.screenupdating=Falsefileopen= Application.getopenfilename (filefilter:="Microsoft Excel Files (*.xls), *.xls", Multiselect:=true, title:="Merge Workbook name") X=1While X<=UBound (FileOpen) workbooks.open Filename:=FileOpen (X) Sheets (). Move after:=thisworkbook.sheets (ThisWorkbook.Sheets.Count) X= X +1WendExitHandler:Application.ScreenUpdating=trueexit suberrhadler:msgbox err.descriptionend Sub

4. Run the sub-process/UserForm, select multiple Excel to merge , click OK, and you can see that the files are integrated into one Excel

5. Check the data, Ctrl+s save

6. Import data into Sqlserverdb, open Data, link, select the DB point that will be data to, right-click->tasks->importdata--->next

7. Select the data source, here is the Excel file select "Microsoft Excel", if it is notepad. txt, select Flat File source, other depending on the situation,

Click Browse ... Select the imported file, Totaldata.xlsx, and then Next

8. Choose the mode of login, link the way servername general "." Local link, then next

9. Default next-> default next->

10.next-> is done by default!

Multiple Excel files are quickly imported into the DB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.