The SQL Server (Transact-SQL) UPDATE statement is used to update existing records in a table in a SQL Server database.
There are 3 syntaxes for the UPDATE statement depending on whether you are performing a traditional update or updating one table with data from another table.
So I need to update the table in the new DB from the table in the old DB which has around 1000 rows.
In other words, I need to update the Unfortunately, your question is not clear.
The data in all the other fields in the existing table is still correct.
Is there any way—short of using a complex VBA procedure—to update the price data in the existing table based on the updated prices from the imported table without overwriting any of the other fields in the existing table?
You probably already know that you can use an update query to update the values of fields in a table, but did you know that you can use an update query to update the values in one table with the values from another? If you can join the two tables on some common field or combination of fields, you can use an update query to update a field in one table based on the values found in a second table.
This action query will take the Purchase Price values from tbl Albums Updated and copy it into the Purchase Price field in tbl Albums for each record where the two Album ID fields match and the price value in tbl Albums is currently null.
When the query is finished, open tbl Albums again—you should see that the Purchase Price field in this table has been updated based on the values in tbl Albums Updated (see Figure 1-18).
I want to update the school_code column in the student table with the school_id column in the school code table based on school code and year.