Insert data from Excel to SQL database

Sachin_Kharmale

Active Member
Hi Shraddha,

If you have SSMS (SQL Server Management Studio installed on your machine then you can follow following steps.
To Insert bulk of data from excel sheet to sql
  1. Open SQL Server Management Studio and connect to your SQL Server database.
  2. Expand the Databases and the Tables folders for the table where you would like to insert your data from Excel.
    Excel-to-SQL-Server-select-database.png

    1. Right-click the table and select the fourth option – Edit Top 200 Rows.
      Excel-to-SQL-Server-edit-top-200-rows.png
    2. The data will be loaded and you will see the first 200 rows of data in the table.
      Excel-to-SQL-Server-table-rows.png
    3. Switch to Excel and select the rows and columns to insert from Excel to SQL Server.
      Right-click the selected cells and select Copy.
      Excel-to-SQL-Server-copy-from-Excel.png
    4. Switch back to SQL Server Management Studio and scroll down to the last row at the bottom and locate the row with a star in the left-most column.
      Excel-to-SQL-Server-paste-Excel-data-into-SQL-Server-table.png
    5. Right click the star in the column header and select Paste.
      Excel-to-SQL-Server-paste-Excel-data-into-SQL-Server-table-row.png
    6. Your data from Excel is now pasted into your table in SQL Server!
  3. Remember: Always start with copying and pasting a single row of data from Excel to SQL Server. This is to check that there are no mismatches between your data from Excel and the SQL Server table (such as the number of columns) and that your data in Excel validates with the data types in the SQL Server table. See the section “Tips and tricks” below for more details.

 
Top