Codefixer - ASP tutorials, resources and software
ASP.NET 3.5/2.0 Hosting – Click Here
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Tuesday 13 May
MembersPro PayPal - ASP Membership software

asp.netPRO “Best ASP.NET Host” – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

SQL explained: What is SQL | Select Statement | Select Where | Insert | Update/Edit | Delete | Order By | Select Between

SQL Update Statement

Syntax: UPDATE TableName Set ColumnName=Value WhereColumnName2=Value2

If we wanted to update the records from our table 'Members_tbl' in Diagram 1 where the LastName is Jones AND City is equal to Belfast and change the City column value to Belfast we could use the following update SQL statement.

UPDATE Members_tbl Set City='Dublin' Where LastName='Jones' AND City='Belfast'

Diagram 1
Update SQL statement

Diagram 2 shows the results of running our SQL Update.

Diagram 2
Update SQL

If you were to run an SQL Update statement to update all the rows in our table 'Members_tbl' (as it was in Diagram 1) where the City column held the value Belfast then this would have an effect of updating more than one record in our example.
You could also introduce OR as our SQL update statement does below.

UPDATE Members_tbl Set City='Dublin' Where FirstName='Dave' OR City='Belfast'





ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software