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 |
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-04-08 : 12:49:05
|
Hi, I am running this code :--update #ff_1 SET #ff_1.upc = case when ff_discontinued.itemnmbr IN(select itemnmbr from #ff_1) then '*'+ #ff_1.upc else #ff_1.upc end from ff_discontinued right join #ff_1 a on a.itemnmbr= ff_discontinued.itemnmbrselect * from #ff_1ERROR:-Msg 4104, Level 16, State 1, Line 2The multi-part identifier "#ff_1.upc" could not be bound.Regards,SushantDBAWest Indies |
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2011-04-08 : 13:02:53
|
[code]UPDATE aSET #ff_1.upc =case when ff_discontinued.itemnmbr IN(select itemnmbr from #ff_1) then '*'+ #ff_1.upc else #ff_1.upc endfrom ff_discontinuedright join #ff_1 aon a.itemnmbr= ff_discontinued.itemnmbr;[/code]______________________ |
 |
|
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-04-08 : 13:10:01
|
:(Same errorRegards,SushantDBAWest Indies |
 |
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2011-04-08 : 13:13:45
|
Oh,What about this?UPDATE aSET a.upc =case when ff_discontinued.itemnmbr IN(select itemnmbr from #ff_1) then '*'+ a.upc else a.upc endfrom ff_discontinuedright join #ff_1 aon a.itemnmbr= ff_discontinued.itemnmbr; ______________________ |
 |
|
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-04-08 : 13:27:00
|
It worked...Thanks.Regards,SushantDBAWest Indies |
 |
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2011-04-08 : 13:34:29
|
you are welcome______________________ |
 |
|
|
|
|