如何用存储过程实现一次插入多条记录?
比如:我新建一张表t_course
create table t_course(number char(4),names char(10),teacher char(10),hours int,credit int)
创建存储过程 proc_insert:
create proc proc_insert
@c_number char(4),@c_name char(10),@teacher char(10),@hours int,@credit int
as
BEGIN transaction
insert into t_course(number,names,teacher,hours,credit)
values (@c_number,@c_name,@teacher ,@hours ,@credit)
if @@error<>0
Begin
Rollback tran
Return
end
commit transaction
如何显示插入多条记录呢?