Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 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
30421 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  
 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