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 |
|
jbates99
Constraint Violating Yak Guru
396 Posts |
Posted - 2010-04-21 : 11:15:22
|
| hi experts,UPDATE TestDups SET TestDups.lngCompanyID = Test.lngCompanyIDWHERE TestDups.strCompanyName = Test.strCompanyNameAND TestDups.strAddress = Test.strAddress;I get this error:The multi-part identifier "Test.strCompanyName" could not be bound. The multi-part identifier "Test.strAddress" could not be bound.I'm sure there is way to update the column but I'm lost as to how.Thanks, John |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-21 : 11:20:40
|
Your TABLE Test occurs not in your query.Try this:UPDATE tdSET lngCompanyID = t.lngCompanyIDfrom TestDups tdjoin Test t on td.strCompanyName = t.strCompanyNameAND td.strAddress = t.strAddress; No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
jbates99
Constraint Violating Yak Guru
396 Posts |
Posted - 2010-04-23 : 17:50:30
|
| Thank you, webfred. This worked perfectly! |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-24 : 06:22:25
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|