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 ....
Iftikar HussainPosted Jul 24, 2013, 12:57 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:51 AM
as
begin
update tablename
set salary= case
when salary< 5000 then salary * 1.1
else salary
end
end
Jignesh TrivediPosted Jul 23, 2013, 10:59 PM
try
CREATE PROCEDURE TempSP
AS
BEGIN
update Table1
set NetPay = salary + (salary *10)/100
where salary <=5000
END
hope this will help you.
Sanjeeb LenkaPosted Jul 23, 2013, 4:07 PM
CREATE PROCEDURE hike
AS
BEGIN
UPDATE yourtablename
SET NetPay = CASE
WHEN Salary < 5000 THEN Salary * 1.1
ELSE Salary
END
END