Import all worksheets of the same structure in an Excel file to the same table in sql2005. A large number of images are used to illustrate the entire process.
1. The test environment is one sheet in an Excel file.
2. Enable Microsoft Visual Studio 2005 or SQL server business intelligence installed with sql2005
Development studio to create a business intelligence project.
3. Create a New ADO. net connection in the Connection Manager.
4. Create a connection
5. Select the jet ole db data source.
6. Select an Excel file, which is MDB by default. You need to display all the files (*. *) before selecting Excel
7. Select All-marked in red and select excel5.0.
In this way, the link used to traverse the Excel architecture is established.
8. Create a circular container
9. The cycle editor configuration is as follows:
10. Create a new variable ing to save the traversal to the table name.
11. Variables
The circular container is OK.
12. Add a Data Flow task to the container
13. Set an Excel Source
14. Set Excel connections and worksheets
15. Set oledb targets
16. Connect the Green Arrow
17. Edit the oledb target and select an sqlserver data table. The table must already exist. Here we create an ssistest database to generate a table TT with the same structure as Excel.
Create Table TT (A varchar (100), B varchar (100), c varchar (100), d varchar (100 ))
Then use oledb to connect
18. Edit the ing and link. The default value is OK.
19. At last, we need to replace the selected Excel source with loop variables in advanced settings (I have been searching for it for a long time)
20. The configuration is as follows:
21. Complete. you can press the debug button to start the task test.
Similarly, you can set the target's advanced level to import tables with different sheet structures. In addition, you can combine the previous article, import all Excel files in the folder in batches to import all sheet files in all Excel files in batches.
Related Articles:
Illustration: SSIS batch import of Excel files
Refer to msdn
Http://msdn.microsoft.com/en-us/library/ms345182.aspx