Iam abhilash ..
suppose we have 4 fields .. like Empid ,Name,Salary,NetPay..
who's employees earn < 5000 salary those people get 10% comission so that employees salary +comission ..updated into NetPAy column in same table four fields..
i need stored procedure ....

Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 23, 2013, 12:07 PM EDT
CREATE PROCEDURE hike
AS
BEGIN
UPDATE yourtablename
SET NetPay = CASE
WHEN Salary < 5000 THEN Salary * 1.1
ELSE Salary
END
END
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 23, 2013, 6:59 PM EDT
try
CREATE PROCEDURE TempSP
AS
BEGIN
update Table1
set NetPay = salary + (salary *10)/100
where salary <=5000
END
hope this will help you.
Pankaj PandeyRank #642 · 3.7K reputationPosted Jul 23, 2013, 8:51 PM EDT
as
begin
update tablename
set salary= case
when salary< 5000 then salary * 1.1
else salary
end
end
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 23, 2013, 8:57 PM EDT
Try like this
update Emptable
set Netpay=CASE WHEN salary<5000 THEN Netpay+((salary*10/100))
ELSE Netpay end
Regards,
Iftikar