Collections:
Updating Values with UPDATE Statements in SQL Server
How To Update Values in a Table with UPDATE Statements in SQL Server?
✍: FYIcenter.com
If you want to update some values in one row or multiple rows in a table, you can use the UPDATE statement. The tutorial script below shows a good example:
SELECT * FROM fyi_links WHERE id = 101 GO id url notes counts created 101 dev.fyicenter.com NULL 0 2006-04-30 UPDATE fyi_links SET counts = 999, notes = 'Good.' WHERE id = 101; GO (1 row(s) affected) SELECT * FROM fyi_links WHERE id = 101 GO id url notes counts created 101 dev.fyicenter.com Good. 999 2006-04-30
As you can see, the SET clause takes column and value pairs to provide new values, while the WHERE clause defines which row to apply the update.
2016-11-02, 659👍, 0💬
Popular Posts:
Where to find Oracle database server tutorials? Here is a collection of tutorials, tips and FAQs for...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How To Start Instance with a Minimal Initialization Parameter File in Oracle? The sample initializat...