CREATE PROCEDURE salemp
( @employeeId int, @ID int, @processedon DateTime, @salary int )
As
IF EXISTS(SELECT 'True' FROM payroll WHERE employeeId=@employeeId)
BEGIN --This means it exists, return it to ASP and tell us SELECT 'This record already exists!'
END
ELSE
BEGIN --This means the record isn't in there already, let's go ahead and add it SELECT 'Record Added'
INSERTintopayroll(ID,processedon,employeeId,salary) VALUES(@ID,@processedon,@employeeId,@salary)
END
update payroll set salary = (employee.Basicsalary +employee.HRA + employee.Allowance - employee.Deductions) from employee where employee.employeeId = payroll.employeeId;
SQL procedure not working through c# code
Does DTS export destination database need to be installed?
SQL using wildcard to remove text in the middle of a string that contains different values
Select customers having age between date range
Want to capture comments from a stored procedure in a result set.