创建一个带有参数的存储过程stu_info,该存储过程根据传入的课程编号,在课程表中查询此课程的信息。调用此

2025-02-25 18:58:39
推荐回答(3个)
回答1:

create proc stu_info
@课程编号 int --你编号的类型自己修改
as
select *from 课程表 where 课程编号=@课程编号
go
--SQL中运行调试
exec stu_info '123'

回答2:

create proc stu_info
@课程编号 CHAR(12) --你编号的类型自己修改
as
begin
select *from 课程表 where 课程编号=@课程编号
end
go
--ceshi
exec stu_info '123'

回答3:

create proc stu_info
@aa int
as
select * from stuinfo where 课程编号字段名=@aa