- 12
- 0
- 约2.9千字
- 约 6页
- 2017-07-27 发布于湖北
- 举报
实验七存储过程和触发器
实验七 存储过程和触发器
一、实验目的:理解存储过程概念、类型;掌握各种存储过程创建方法和查看、修改、删除存储过程方法。
二、实验内容及步骤
1、使用T-SQL语句创建存储过程
(1)创建不带参数存储过程
1)创建一个从student表查询学号为95002学生信息的存储过程proc_1,其中包括学号、姓名、性别、出生日期、系别等;调用过程proc_1查看执行结果。
use 选课系统
go
create procuse 选课系统
gouse 选课系统
go
create procuse 选课系统
gouse 选课系统
go
create procuse 选课系统
gouse 选课系统
go
create proc student_procAs
If @startdate is null or @enddate is null
Begin
Raiserror(‘null value are invalid’,5,5)
Return
End
Select * from 学生信息表
Where birthday between @startdate and @enddate
Select @recordcount=@@rowcount
go
执行语句:
use 选课系统
go
declare @recordn int
exec student_proc4 01/01/1988,0
原创力文档

文档评论(0)