Skip to Content
SQL Server 2014 Development Essentials
book

SQL Server 2014 Development Essentials

by Basit A. Masood-Al-Farooq
July 2014
Intermediate to advanced
214 pages
4h 47m
English
Packt Publishing
Content preview from SQL Server 2014 Development Essentials

Updating data in SQL Server database tables

You use the UPDATE statement to modify an existing table data.

To execute the UPDATE statement, a user must have at least an UPDATE permission assigned on the target table.

The following is the basic syntax for the UPDATE statement:

[WITH <common_table_expression> [, ...n]]
UPDATE
[TOP (expression) [PERCENT]]
table_name | view_name | rowset_function | common_table_expression
[WITH table_hint]
SET column_name = {expression | DEFAULT | NULL} [ ,...n ]
<outputclause>
FROM < table_name | view_name | common_table_expression>
WHERE <search_condition>

The following are the arguments of the UPDATE statement:

  • WITH: This keyword specifies the CTE that you can reference in your UPDATE statement
  • TOP: You specify this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What's New in SQL Server 2012

What's New in SQL Server 2012

Rachel Horder
Mastering SQL Server® 2008

Mastering SQL Server® 2008

Michael Lee, Gentry Bieker
Microsoft® SQL Server 2012 Unleashed

Microsoft® SQL Server 2012 Unleashed

Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein

Publisher Resources

ISBN: 9781782172550Supplemental Content