自定义储过程
use StuManageDB
go
if exists(Select * from sysobjects where name='usp_ScoreQuery')
drop procedure usp_ScoreQuery
go
create procedure usp_ScoreQuery --创建存储过程
as
--查询考试信息
select Students.StudentId,StudentName,ClassName,ScoreSum=(CSharp+SQLServerDB)
from Students
inner join StudentClass on Students.ClassId = StudentClass.ClassId
inner join ScoreList on Students.StudentId = ScoreList.StudentId
order by ScoreSum DESC
go
ex