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

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to interchange data between column

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2006-09-09 : 06:19:25
I have one table NewTab with column Col1,Col2 and col3 with following data

Col1 Col2 Col3
1 2 Null
1 3 Null
1 4 Null
1 5 Null
7 10 Null
7 9 Null
7 8 Null
7 7 Null

I want to interchange the data between Col2 to Col3 .The resulte should be

Col1 Col2 Col3
1 NULL 2
1 Null 3
1 Null 4
1 Null 5
7 Null 10
7 Null 9
7 Null 8
7 Null 7

Please tell me how I can interchange this data (which method)

SQLTeam

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-09-09 : 06:23:35
Update YourTable Set Col2 = Col3, Col3= Col2

Chirag
Go to Top of Page
   

- Advertisement -