Hii ...
Iam abhilash ..
we have four feilds like Empid,name,salary,Netpay,,,
who earn <5000 salary those people get 10% hike added to salary updated into Netpay column
i nees stored procedure
this is my mail id: [email protected]
thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 24, 2013, 12:56 AM
Try like this
update Emptable
set Netpay=CASE WHEN salary<5000 THEN Netpay+((salary*10/100))
ELSE Netpay end
Regards,
Iftikar
Pankaj PandeyPosted Jul 24, 2013, 12:49 AM
as
begin
update tablename
set salary= case
when salary< 5000 then salary * 1.1
else salary
end
end
Jignesh TrivediPosted Jul 23, 2013, 11:11 PM
I think this duplicate post of
http://www.c-sharpcorner.com/Forums/Thread/220269/need-help-about-stored-procedure.aspx
so can please close it?
Sanjeeb LenkaPosted Jul 23, 2013, 4:05 PM
CREATE PROCEDURE hike
AS
BEGIN
UPDATE yourtablename
SET NetPay = CASE
WHEN Salary < 5000 THEN Salary * 1.1
ELSE Salary
END
END