Hi,
I have created a table "Employee" and inserted few datas into it and then created a procedure but it didnt execute,please correct my code and explain me where i went wrong. the commands are as follows.
Create table Employee(
Employee_id int NOT NULL PRIMARY KEY,
Employee_firstname varchar(20),
Employee_surname varchar(20) NOT NULL,
Address varchar(30)NOT NULL,
Designation varchar(20) NOT NULL,
Salary decimal(6,2),
Department_id int NOT NULL,
Department_name varchar(20) NOT NULL
)
Insert into Employee values(001, 'Rakesh', 'Panda','CP3,sector-8,HCL Technology','Support Analyst',3.5,10,'IT')
Insert into Employee values(002, 'Monalisa', 'Mohanty','CP3,sector-8,HCL Technology','Program Analyst',4.5,10,'IT')
Insert into Employee values(003, 'Ajay', 'Kumar','CP3,sector-8,HCL Technology','Employee Partner',3.2,20,'HR')
Insert into Employee values(004, 'Nikhil', 'Srivastav','CP3,sector-8,HCL Technology','Transport Manager',3.0,30,'Admin')
Insert into Employee values(005, 'Parul', 'Mehta','CP3,sector-8,HCL Technology','project Lead',6.5,10,'IT')
Create procedure raise_salary(
@id INT,
@salary decimal OUT,
@percent decimal)
AS
begin
update Employee
set Salary = Salary*(1+ percent/100)
where Employee_id = @id
End
Thanks
Rakesh