Friday 22 May 2015

I have a Columnname as ID and its Row Values are 1,1,2,2 How to Replace the value of 1 as 2 and 2 as 1 in the table.

create procedure replace1122
as
begin
select * from relaceid
update relaceid set id =3 where id=1
update relaceid set id =1 where id=2
update relaceid set id =2 where id=3
select * from relaceid

end

                                           Original Table   and  table  After  Executing SP



No comments:

Post a Comment