创建带输入参数存储过程
use yanantest
go
if exists (select * from sys.objects where name='yanan')
drop procedure yanan
go
create proc yanan(@name varchar(2))
as
select * from student where name=@name;
go
创建带输入参数存储过程
if exists(select * from sys.objects where name='yanan2')
drop proc yanan2
go
create proc yanan2 (@name varchar(2),@age int output)
as
begin
select @age=age from student where name=@name;
end
go
declare @age int
exec yanan2 'ls', @age output
select @age
mybatis调用:
<select id="getUsers" resultType="User">
exec yanan_getUsers 'zs';
</select>
20180810:查看另一篇更详细的博客
https://www.cnblogs.com/yanan7890/p/8776379.html