HOME
> Components
> Sql Server Update - How To Use The Update Statement
SQL Server Update - how to use the update statement
With a SQL Server you have the possibility to store and manage large amounts of data within a database. If you want to make changes to the database, you need the various SQL statements. With the Update Statement you edit already existing entries of the database.
How to use the Update Statement with a SQL Server
If you use a SQL Server, you can edit the entries, add new ones or create tables through various SQL Statements. With the update statement you have the possibility to edit single entries.- If you want to edit one or more entries within a table, then write "UPDATE table SET column1=value1, column2=value2". Instead of "table" write the table name. Also replace the respective placeholders with the corresponding column names and the new entry.
- If you still write a "Where" statement after the statement, you can also change certain entries.
- If, on the other hand, you want to update a table with data from another table, write "UPDATE table1 SET column1 = (SELECT value1 FROM table2 WHERE condition)". Again, you must replace the placeholders with the names of your database.
- The update statement can be extended and modified as desired, depending on what you need. Here, only the syntax of SQL must be followed.
- An example of an update of an entry in the table "Test" would be: "UPDATE Test SET Name = 'ComputerBild' WHERE ID = 1;". Here, the name of the entry with ID "1" in the "Test" table is changed to "ComputerBild".