declare @temp table(gender nvarchar(50) null) insert into @temp (gender) select 'Male' union all select 'FeMale' union all select 'FeMale' union all select 'Male' union all select 'FeMale' select * from @temp update @temp set gender=(case (gender) when 'Male' then 'M' else 'F' end) from @temp select * from @temp
UPDATE [YourTableName] SET GENDER=(CASE WHEN GENDER = 'Male' THEN 'M' ELSE 'F' END)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)