How to import data in Excel into the SQL Server 2000 database

zhaozj2021-02-16  51

1. Open Enterprise Manager, open the database to import data, press Right-click on the table, all tasks -> Import data, pop up the DTS Import / Export Wizard, press Next, 2, select the data source Microsoft Excel 97-2000, File Name Select the XLS file to import, press Next, 3, select the purpose of the Microsoft OLE DB provider for SQL Server, select local (if it is a local database, such as VVV), use SQL Server authentication, username SA, password is empty, the database selects the database to import data (such as a client), press Next, 4, select a query to specify the data to be transferred, press Next, 5, press the query generator, in the source table list There is a column of the XLS file to be imported, add each column to the selected list list, which must be noted that the order in which the column is added must be the same as the order defined in the database, otherwise it will be wrong, press Next, 6, select the order to be arranged in this step, the column selected in this step is the column followed by the order by the order by the order, press Next, 7. If you want to import, choose all lines. Press Next, 8, will see the query statement generated according to the previous operation, after confirmation, press Next, 9, see the list / worksheet / Excel named area list, in the destination column, choose to import data The table, press the next step, 10, choose to run immediately, press Next, 11, will see the summary of the entire operation, press it.

Of course, in the above steps, some steps can have a variety of options, you can select the appropriate options according to your needs. For example, friends who are interested in programming can choose to save the DTS package at step 10, save into a Visual Basic file, and can look at the code in it, improve your programming level.

转载请注明原文地址:https://www.9cbs.com/read-22612.html

New Post(0)