CREATE PROCEDURE sp_calculatesalarybegin(@EmployeeId as int)
CREATE PROCEDURE sp_calculatesalary
(@EmployeeId as int)
declare dynsql as varachar(500) @dynsql='Select @Salary=Salary,@UserName=Username from employee where EmployeeId='+cast(@EmployeeId as varchar)+ '' exec(@dynsql)end
declare dynsql as varachar(500)
@dynsql='Select @Salary=Salary,@UserName=Username from employee where EmployeeId='+cast(@EmployeeId as varchar)+ ''
exec(@dynsql)end
exec(@dynsql)