Answered by:
Inserting Specific columns to SQL Table from Excel Sheet

Question
-
Hello Everyone !
I need some help, basically I have a SQL Server 2008 running with MS office 2007, I want to insert some specific columns from my excel spreadsheet to my sql server database. I have some relevant images underneath for better understanding.
Those are the record which i want to insert in my sql table which is underneath.
I want to insert those selected record underneath the column "Rosemary Jones".
Any help will be Appreciated.
Thanks
- Changed type Naomi N Thursday, December 20, 2012 2:39 PM Question rather than discussion
Wednesday, December 19, 2012 12:37 PM
Answers
-
http://stackoverflow.com/questions/3474137/how-to-export-data-from-excel-spreadsheet-to-sql-server-2008-table
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Blog: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
- Marked as answer by Allen Li - MSFT Wednesday, December 26, 2012 1:58 AM
Wednesday, December 19, 2012 2:10 PMAnswerer -
You can use the SSIS Import/Export Wizard:
http://www.sqlusa.com/bestpractices/ssis-wizard/
You can delete what you don't need in the staging table.
Kalman Toth
New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2016- Marked as answer by Allen Li - MSFT Wednesday, December 26, 2012 1:58 AM
- Edited by Kalman Toth Wednesday, November 8, 2017 6:34 PM
Thursday, December 20, 2012 1:45 AM
All replies
-
http://stackoverflow.com/questions/3474137/how-to-export-data-from-excel-spreadsheet-to-sql-server-2008-table
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Blog: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
- Marked as answer by Allen Li - MSFT Wednesday, December 26, 2012 1:58 AM
Wednesday, December 19, 2012 2:10 PMAnswerer -
You can use the SSIS Import/Export Wizard:
http://www.sqlusa.com/bestpractices/ssis-wizard/
You can delete what you don't need in the staging table.
Kalman Toth
New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2016- Marked as answer by Allen Li - MSFT Wednesday, December 26, 2012 1:58 AM
- Edited by Kalman Toth Wednesday, November 8, 2017 6:34 PM
Thursday, December 20, 2012 1:45 AM -
If you don't want to import the data like suggested by others, you can just copy the data from Excel to SSMS.
Like you do above, you copy the data from Excel - then you go to SSMS, right click on your table and choose "Edit all rows". You then place the cursor where you want to insert the first line of your data and then paste in your data. You might have to place the cursor in the left hand side over the "*" when you want to insert several lines at once. If you place the cursor in one of the "fields" I have sometimes seen that it only inserts the first row of the data you have selected where placing it in the left hand side seems to insert all records. (there might be a good explanation to this, but I do it so seldom that I've never bothered figuring it out...).
Steen Schlüter Persson (DK)
Thursday, December 20, 2012 10:12 AM