第七章:存储过程
来源:互联网 发布:淘宝卖家钱多久到账 编辑:程序博客网 时间:2024/06/05 03:23
--上机1 exec sp_help student exec sp_columns student exec sp_helpconstraint student --上机2 if exists(select * from sysobjects where name='usp_getsubject') drop procedure usp_getsubject go create procedure usp_getsubject as select gradename,subjectname,classhour from Subject inner join Grade on Grade.GradeId=Subject.GradeId order by GradeName go exec usp_getsubject --上机3 if exists(select * from sysobjects where name='usp_getsubject') drop procedure usp_getsubject go create procedure usp_getsubject @grade nvarchar(50) as select gradename,subjectname,classhour from Subject inner join Grade on Grade.GradeId=Subject.GradeId where GradeName=@grade order by GradeName go exec usp_getsubject 'S1' exec usp_getsubject 'S2' exec usp_getsubject 'Y2' --上机4 if exists(select * from sysobjects where name='usp_getsubject') drop procedure usp_getsubject go create procedure usp_getsubject @classnum int output, @classhour int output, @grade nvarchar(50) as select gradename,subjectname,classhour from Subject inner join Grade on Grade.GradeId=Subject.GradeId where Gradename=@grade order by GradeName print '学期名称 课程数目 总课时' print @grade+''+cast(@classnum as nvarchar(50))+''+cast(@classhour as nvarchar(50)) go declare @classnum int declare @classhour int exec usp_getsubject @classnum output,@classhour output,'S1' exec usp_getsubject @classnum output,@classhour output,'S2' exec usp_getsubject @classnum output,@classhour output,'Y2'
0 0
- 第七章存储过程
- 第七章:存储过程
- 第七章:存储过程
- 优化MyShool 第七章 存储过程
- SQL高级 第七章 存储过程
- 优化MYSCHOOL第七章存储过程 上机简答
- Mysql系列课程--第七章 触发器和存储过程
- 第七课 使用存储过程(翻译)
- 第七节 存储过程 (含函数)
- 第七章 事务、过程、触发器
- ADO.NET_第七篇_OracleCommand_05执行存储过程
- ASP.NET中利用存储过程实现模糊查询(转自第七频道)
- 第七章(2).图的邻接表存储表示
- 第十二章 管理存储过程
- [深入理解Java虚拟机]第七章 类加载的过程
- 《Kotlin 程序设计》第七章 Kotlin 编译过程分析
- MySQL存储过程编程教程读书笔记-第二章MySQL存储过程编程指南-存储过程部分
- 存储过程
- PyCharm2016.3 专业版注册码
- 第八章:课程总复习项目
- Android4.1及以下RadioButton向右偏移不居中
- spring配置文件详解
- IDEA 专门发布了一个golang的IDE叫Goland
- 第七章:存储过程
- 关于指针的15个经典面试题
- 第六章:事务,视图和索引
- 第五章:项目:我的租房网
- 知识库--Using Akka Refs and Transactions(124)
- 学习笔记1--协方差矩阵
- 第四章:高级查询
- WEB入门之十六 操作DOM节点
- 第三章:SQL 编程