SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Update Query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lokhande.shirish
Starting Member

4 Posts

Posted - 01/17/2007 :  06:47:59  Show Profile  Reply with Quote
Hi,

I am having a table with two column. NameID and Name.

Table having 4 rows. Name column have A,B,A,B

I want to write a update query so that so that A will interchange with B and vice-a-versa.

Thanks,

Shirish

SwePeso
Patron Saint of Lost Yaks

Sweden
30277 Posts

Posted - 01/17/2007 :  06:55:22  Show Profile  Visit SwePeso's Homepage  Reply with Quote
UPDATE <YourTableNameHere>
SET Name = CASE WHEN Name = 'A' THEN 'B' ELSE 'A' END


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000