实验八(上):QL Server用户自定义函数和触发器.docVIP

  • 55
  • 0
  • 约8千字
  • 约 6页
  • 2016-10-14 发布于贵州
  • 举报

实验八(上):QL Server用户自定义函数和触发器.doc

实验八(上):QL Server用户自定义函数和触发器

实验八(上) 用户自定义函数和触发器 一、实验目的回标量值的用户定义函数 ectangleArea:输入矩形的长和宽就能计算矩形的面积。自选2种实例调用该函数。 create function RectangleArea(@a int,@b int) returns int as begin return @a*@b end declare @area int execute @area=RectangleArea 3,5 print (矩形面积是:) print @area declare @area int execute @area=RectangleArea 7,8 print (矩形面积是:) print @area 创建一个用户自定义函数(内嵌表值函数create function Search (@sdept char(10)) returns table as return ( select sc.sno 学号,student.sname 姓名,course.cname 课程名,sc.grade 成绩, student.sdept 系别from sc,student,course where course.cno=sc.cno and sc.sno = student.sno and sdept=@sdept ) select * fro

文档评论(0)

1亿VIP精品文档

相关文档