ASP中SQL语句使用问题
怎样在ASP中使用长的批处理?
批处理如下
use xuejiguanli
declare @ying int
SET @ying=(select sum(x.应获学分)from xuefen x,xuefen y where x.学号=y.学号)
declare @suo int
set @suo=(select sum(x.所获学分)from xuefen x,xuefen y where x.学号=y.学号)
declare @cha int
set @cha=@ying-@suo
select distinct xuefen.学号,student.姓名
from xuefen,student
where @cha <15 and student.学历名= '本科 '
group by xuefen.学号,student.姓名
having count(xuefen.学期)=8
union
select distinct xuefen.学号,student.姓名
from xuefen,student
where @cha <15 and student.学历名= '专科 '
group by xuefen.学号,student.姓名
having count(xuefen.学期)=6
union
select distinct xuefen.学号,student.姓名
from xuefen,student
where @cha <15 and student.学历名= '专升本 '
group by xuefen.学号,student.姓名
having count(xuefen.学期)=4 "
急 大家帮帮忙 谢谢
------解决方案--------------------写到存储过程中,用asp调用存储过程.