Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

Copy and paste columns from excel to a sql server table

  • 25 July 2010
  • Author: indupriya
  • Number of views: 5226
  • 0 Comments

This article describes an easy way to copy and paste columns from excel to a sqlserver table.  The basic requirement for this is the column names in both excel and sql server tables should be the same. 

 

The excel file sample used in this article has three columns.  Ethnicity_id, Ethnicity and Employees.

The first step is to create a database and a table with the same columns as in the excel spreadsheet.

I have used the test database as shown below.

Create Table

 

The next step is to copy the data from the excel file as shown below.  Make sure you copy the data only (Ctrl+C).

copy data from excel

 

The next step is to open the SSMS and right click on the table (Test table that you have created).  Click on Open Table from the menu that appears.

Open Table

When the table opens, click on the top left corner as shown in the screen below.

 left clikc area

 

The row gets highlighted as shown above.  Now right click on the top left corner and choose paste.  This will paste the values from excel to the sql server table.

Paste

 

This procedure is mainly useful when there are ad-hoc requests that require you to copy data from excel into a table.

 

 

Print
Categories: Miscellaneous
Tags:
Rate this article:
No rating

indupriyaindupriya

Other posts by indupriya

Please login or register to post comments.