快疯了,一个很。。。的错误!
alter proc zonghetongji-- '全部 ', '全部 ', '2007-1-1 ', '2007-12-31 ', '全部 ',1,300
@danwei varchar(100)= '全部 ',
@jigou varchar(100)= '全部 ',
--@start varchar(20),
--@stop varchar(20),
@do varchar(10)= '奖励 '
--@down int,
--@top int
as
begin
declare @tongji table
(
id int identity primary key,
name varchar(50),
avgg int,
zongCount int,
jiang int,
cheng int
)
declare @avg int
declare @zongCount int
declare @jiang int
declare @cheng int
declare @name varchar(50)
if (@danwei= '全部 ' and @jigou= '全部 ')
begin
if @do= '全部 '
begin
insert into @tongji(name) select distinct 名称 from 部门信息
declare @cursor cursor
set @cursor=cursor scroll for select name from @tongji
open @cursor
fetch next from @cursor into @name
while(@@fetch_status=0)
begin
fetch &nbs