Hi Everyone:
I have add one column into my table and I want to set the value of this column based on another column in the table,and the following is the code how I do it...but it didn't seem to work...and Can anyone kindly take a look my code and let me know what is wrong? Thanks alot
Declare @DetailName varchar(50)
UpDate #TempTable
Set [Detail Name] = @DetailName
select @DetailName = case when [Flavor] = '1' then 'Apple'
when [Flavor] = '2' then 'Orange'
When [Flavor] = '3' then 'pear'
End
From #TempTable
I have add one column into my table and I want to set the value of this column based on another column in the table,and the following is the code how I do it...but it didn't seem to work...and Can anyone kindly take a look my code and let me know what is wrong? Thanks alot
Declare @DetailName varchar(50)
UpDate #TempTable
Set [Detail Name] = @DetailName
select @DetailName = case when [Flavor] = '1' then 'Apple'
when [Flavor] = '2' then 'Orange'
When [Flavor] = '3' then 'pear'
End
From #TempTable