Brettb.Com
  HOME | ABOUT ME | BIOTECHNOLOGY | ARTICLES | GALLERY | CONTACT
Search: Go
TECHNICAL ARTICLES
 ASP
 ASP.NET
 JavaScript
 Transact SQL
 Other Articles
 Software Reviews

PHOTO GALLERIES
 Canon EOS 300D Samples
 Akihabara Maids!
 More Galleries...

TRAVEL LOG
 2009: China
 2008: Tokyo
 2007: Tokyo
 2006: Hong Kong
 2005: New York City

MORE STUFF
 Search Engine Optimisation
 Build an ASP Search Engine
 My Tropical Fishtank
 Autoglass
 SQL Month Name
 SQL Get Date Today
 SQL Year Month
 Other New Stuff...

POPULAR STUFF
 Regular Expressions
 Index Server & ASP
 JavaScript Ad Rotator

Home > Articles > Transact SQL Programming Articles

The Syntax of the Transact SQL Update Statement

The SQL Server Transact SQL Update statement can be used to update an existing row or rows of adatabase table. The update statement's syntax is as follows:

UPDATE <table name>
SET <columnname1> = <columnvalue1>, <columnname2> = <columnvalue2>
WHERE <column> = <value>

The WHERE clause in the Update SQL statement is optional. If a WHERE clause is not specified then all of the rows in that table will be updated.

A SQL code syntax example of using the Update statement is shown below:

UPDATE t_Products
SET ProductName = 'Microsoft SQL Server' ProductPrice = '$995'
WHERE ProductID = 112

Table rows can be inserted into a table by using the Insert Into statement. Here's the syntax of the SQL Insert Into query. A table can be created using the SQL Create Table function.

Useful SQL Utilities

  Site Map | Privacy Policy

All content is 1995 - 2012