Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have user table in my DB. I have 1 excel sheet having list of some users (not all) with changes. How can I Update the values given in excel sheet to my user table? is it possible with import data option?

share|improve this question

I only learned this in the past year. You can query an excel sheet as if it's a table. As long as your keys are also in excel you can join the excel sheet to the user table.

You can have a look at this Microsoft Article that discusses options for importing from Excel to SQL Server.

share|improve this answer
Problem is not about joining(appending), I have rows in DB table I have to update the values. the new values are in excel with same field names. – M.S.Nayak Mar 17 '12 at 5:48
The update statement would look the same, you can just treat the excel worksheet like a table using openrowset. Here's another link that may show you in more detail:… – Erik Mar 19 '12 at 13:24

If you are interested, I have built an Excel to SQL Server tool where end users update their data in Excel sheets on the intranet and the application will take care of parsing the Excel spreadsheet and export the data to a SQL Server table.

I'am currently looking for feedback so I give away licenses (two end users) to people who give feedback on the product.

The tool is called SQL Spreads:

Regards, Johannes

share|improve this answer

The workaround is:

  1. Import the Excel sheet to a staging table
  2. Run this SQL query:

    update main_table 
    set main_table.field1 = staging.field1, -- ...
    from main_table
    inner join staging on main.primary_key = staging.primary_key;`
  3. Delete staging table.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.