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 |
|
sam_1
Starting Member
3 Posts |
Posted - 2010-12-08 : 17:59:31
|
| Newbie to SQL hoping someone can help.I have a 200 rows of information where i have to swap the value in two feilds.Feild 1 "Street" Feild 2 "City"i need to swap the values in all 200 rows where datestamp is greater than 07/07/2010 as street name is in the city feild and visa versa.what would the update query look like for this? |
|
|
Skorch
Constraint Violating Yak Guru
300 Posts |
Posted - 2010-12-08 : 18:16:05
|
Something like this:UPDATE YourTableSET Street = City, City = StreetWHERE datestamp > '7/7/2010' Some days you're the dog, and some days you're the fire hydrant. |
 |
|
|
sam_1
Starting Member
3 Posts |
Posted - 2010-12-08 : 18:31:40
|
| thanks for the quick reply i will try this tomorrow and report back.Many thanks,Sam |
 |
|
|
sam_1
Starting Member
3 Posts |
Posted - 2010-12-09 : 17:13:26
|
| Much appreachated all worked a treat. a happy boss!thanks,Sam |
 |
|
|
|
|
|