use xueji
if exists(select * from sysobjects where type='p' and name='stu1')
drop proc stu1
go
create proc stu1
@stu_cur cursor varying output
as
set @stu_cur =cursor scroll static
for select XM,NL from student
open @stu_cur
go
declare @tt cursor,@XM char(6),@NL char(4),@brithday char(4)
exec stu1 @stu_cur = @tt output
while @@fetch_status=0
begin
fetch @tt into @XM,@NL,
@brithday=getdate()-@NL
print @XM+@brithday
end
fetch last from @tt into @XM,@NL
close @tt
deallocate @tt
go
怎么修改才能在sql 2000中显示出出生日期,只要年份就行了,一直提示我
服务器: 消息 170,级别 15,状态 1,行 6
第 6 行: '=' 附近有语法错误。
有会的大侠帮忙改下 谢谢
我用的是SQL 2000