知道函数不能用insert和update,但课本题目就是这样。
你应该去问你们的老师
use hr
go
if exists(select * from sys.sysobjects where [name]='grades')
drop function grades
go
create function grades(@employee_Id int ,@start_date datetime,@job_Id varchar,@department_Id int)
returns table
as
begin
exec proc_update @employee_Id,@start_date,@job_Id,@department_Id
return select * from job_history
end
go
--调用
select * from grades(130,'2015-12-16','1',150)
--------------------------以上是本人从网上查来理解写的--------------------------------