create PROCEDURE proc_add_CW_YJBB02_RK (@yjxh int,@kcsb tinyint,@kssj datetime,@jssj datetime)
AS
BEGIN
--下面为入库方式添加进入财务报表02
declare my_cursor cursor scroll dynamic
for
select rkfs as xmlb,sum(pfzj) as pfhj,sum(lszj) as lshj,sum(lszj)-sum(pfzj) as jxcj
from [View_RKMX] where rkqr=1 and kcsb=@kcsb and yssj between @kssj and @jssj
group by rkfs
open my_cursor
declare @xmlb int
declare @pfhj float
declare @lshj float
declare @jxcj float fetch next from my_cursor into @xmlb,@pfhj,@lshj,@jxcj
while @@fetch_status=0
begin
insert CW_YJBB02(yjxh,xmlb,ckrk,pfhj,lshj,jxcj)
values(@yjxh,@xmlb,0,@pfhj,@lshj,@jxcj)
fetch next from my_cursor into @xmlb,@pfhj,@lshj,@jxcj
end
close my_cursor
deallocate my_cursor
ENDGO
AS
BEGIN
--下面为入库方式添加进入财务报表02
declare my_cursor cursor scroll dynamic
for
select rkfs as xmlb,sum(pfzj) as pfhj,sum(lszj) as lshj,sum(lszj)-sum(pfzj) as jxcj
from [View_RKMX] where rkqr=1 and kcsb=@kcsb and yssj between @kssj and @jssj
group by rkfs
open my_cursor
declare @xmlb int
declare @pfhj float
declare @lshj float
declare @jxcj float fetch next from my_cursor into @xmlb,@pfhj,@lshj,@jxcj
while @@fetch_status=0
begin
insert CW_YJBB02(yjxh,xmlb,ckrk,pfhj,lshj,jxcj)
values(@yjxh,@xmlb,0,@pfhj,@lshj,@jxcj)
fetch next from my_cursor into @xmlb,@pfhj,@lshj,@jxcj
end
close my_cursor
deallocate my_cursor
ENDGO
不知道你的@kcsb 代表啥意思,反正就用tinyint类型的值传进去就可以了
exec proc_add_CW_YJBB02_RK @yjxh=整数,@kcsb=小整数,,@kssj=开始日期,@jssj=结束日期
exec proc_add_CW_YJBB02_RK @yjxh=整数,@kcsb=小整数,@kssj=开始日期,@jssj=结束日期
SqlParameter[] paras = new SqlParameter[] {
new SqlParameter("@yjxh",yjxh),
new SqlParameter("@kcsb",yksb),
new SqlParameter("@kssj",kssj),
new SqlParameter("@jssj",jssj)
};
int res = sqlhelper.ExecuteNonQuery("proc_add_CW_YJBB02", paras, CommandType.StoredProcedure);试过吧那个时间改为DateTime也是不行!有谁能为我解决这个问题阿,求救,在线等
{
bool falg = false;
SqlParameter[] paras = new SqlParameter[] {
new SqlParameter("@yjxh",yjxh),
new SqlParameter("@kcsb",yksb),
new SqlParameter("@kssj",kssj),
new SqlParameter("@jssj",jssj)
};
int res = sqlhelper.ExecuteNonQuery("proc_add_CW_YJBB02", paras, CommandType.StoredProcedure);
if (res > 0)
{
falg = true;
}
return falg;
}