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.
⇒ Updating Multiple Rows with One UPDATE Statement in SQL Server
⇐ Inserting Multiple Rows with One INSERT Statement in SQL Server
2016-11-02, 2365🔥, 0💬
Popular Posts:
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
What Happens If the Imported Table Already Exists in Oracle? If the import process tries to import a...
Where to find SQL Server Transact-SQL language references? You can find SQL Server Transact-SQL lang...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...