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.
Author |
Topic |
melcraig
Starting Member
39 Posts |
Posted - 2006-08-08 : 11:13:55
|
I am trying to convert data to a new db. I have one column where the data is either 'Y' or 'N'.I need to change all the 'Y' to 'N'andchange all the 'N' to 'Y'I would like to do this in a sproc, I will be doing this nightly, but when I do my updates it changes them all to 'N'Please help!Mel |
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-08-08 : 11:28:01
|
Either Use Temp table or First Update Y to Z, N to Y then Z to NSrinika |
 |
|
melcraig
Starting Member
39 Posts |
Posted - 2006-08-08 : 11:51:17
|
Thank You!The update worked great.I was confusing myself and changing everythin back to 'N'Again ThanksMel |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-08-08 : 12:05:10
|
This should do it in one update stetement.Update MyTableset MyCol = case MyCol when 'Y' then 'N' when 'N' then 'Y' else MyColwhere MyCol in ('Y','N') CODO ERGO SUM |
 |
|
|
|
|