创建带参存储过程

1.创建带参存储过程

create proc proc_select_head_branch 
(@head_code VARCHAR(255),@relation_status VARCHAR(255))
as
begin  
	select * from t_head_branch where head_code=@head_code and relation_status=@relation_status
end

2.调用存储过程

exec proc_select_head_branch @head_code='901668148',@relation_status='有效'

你可能感兴趣的:(数据库,sql)