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 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-11-13 : 03:50:34
|
| HiI need to iterate through a datbase table and copy one column value to another column in the same table. How do I do that, I thought that it would be easy but I get an invalid column name error on "VisitingAddressINT"UPDATE dbo.[User] SET VisitingAddressINT = VisitingAddress1INT WHERE VisitingAddress1INT <> '' |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-13 : 03:56:37
|
quote: Originally posted by magmo HiI need to iterate through a datbase table and copy one column value to another column in the same table. How do I do that, I thought that it would be easy but I get an invalid column name error on "VisitingAddressINT"UPDATE dbo.[User] SET VisitingAddressINT = VisitingAddress1INT WHERE VisitingAddress1INT <> ''
Make sure you spelled the column names correctlyMadhivananFailing to plan is Planning to fail |
 |
|
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-11-13 : 04:02:10
|
| It is correct, I copied them from the table design.. but I still get the same error |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-11-13 : 04:18:00
|
quote: Originally posted by magmo It is correct, I copied them from the table design.. but I still get the same error
Will you point the correct DB??Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-11-13 : 04:31:13
|
| Yes I do |
 |
|
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-11-13 : 04:42:05
|
| Argh, it turned out I was indeed trying to update the wrong DB, Thanks! |
 |
|
|
|
|
|