transfer data from Excel to SQL Server

后端 未结 2 1858
别那么骄傲
别那么骄傲 2021-02-09 08:33

I have an Excel Spreadsheet that contains all my data that I need to put into an SQL Server database. I am fairly new o ASP.NET and have never had to export from Excel to SQL Se

2条回答
  •  不思量自难忘°
    2021-02-09 09:12

    You can do this easily using SSIS, you can refer to these two links for full details.

    1. Link 1
    2. Link 2

    [EDIT]

    If you have Express then you can try the below commands to setup a linked server and get the data

    EXEC sp_addlinkedserver ExcelData,'Jet 4.0','Microsoft.Jet.OLEDB.4.0','C:\MyData.xls', NULL, 'Excel 5.0;'
    GO
    

    Then you can select the data into your tables

    INSERT INTO Listings ...
    SELECT column1 AS intListingID,  FROM ExcelData...Data
    GO
    

    For other options check this link

提交回复
热议问题