I’ve added a new column to a database and want to populate it from a spreadsheet. Is there an easy query that will grab the data out based on another column in the spreadsheet that matches the one in the database?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I know of two ways:
Edit the spreadsheet, create a formula like
where A1 represents the first cell with data and B1 is the primary key value to the row that will be updated. Then drag the cell down by the lower right corner so the formula is repeated. Copy the text produced by the formula, paste into SQL Mgmt Studio and run.
Or, you can use MSSQL’s import engine which allows you to select a spreadsheet as your datasource. From there you can map your column to the new column.