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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 update

Author  Topic 

sardinka
Posting Yak Master

142 Posts

Posted - 2005-05-19 : 09:00:12
can I do something like this in update statement
update test
set Code=
Case When Action='D' then 'Failed'end,
from test1

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-05-19 : 09:22:08
yes.

Corey

Secret Service Agent: Mr. President, you're urinating on me.
President Lyndon Johnson: I know I am. It's my prerogative.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-19 : 09:30:40

Yes. How is test is related with test1? if code is the column of the two tables use alias name

update test
set Code=Case When t1.Action='D' then 'Failed' end from test1



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -