You don't need a forum to check syntax. There's a parse button in Management Studio for that. Anyway...declare @tbl table (b_h varchar(9), o_type int, b_code int)insert @tbl (b_h, o_type) select 'b', 0union all select 'b', 1union all select 'b', 0union all select 'a', 1update @tbl set b_code = CASE when b_h = 'b' and o_type = 1 then 1 else 0 endselect * from @tbl
Ryan Randall - Yak of all tradesSolutions are easy. Understanding the problem, now, that's the hard part.