存储过程调用存储过程,变量不能通过?
--存储过程sp_kljcb_cx
CREATE Procedure sp_kljcb_cx
(
@qsrq nvarchar(8),
@zzrq nvarchar(8)
)
AS
--声明变量@qsrq(起始日期),@zzrq(终止日期)
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
--建立临时表#Temp_kljc_flhz
create table #Temp_kljc_flhz(
kl_kcdm varchar(4),
kl_kcmc varchar(40),
kl_spdm varchar(4),
kl_spmc varchar(50),
kl_qcsl numeric(12,4),
kl_drsl numeric(12,4),
kl_zdrsl numeric(12,4),
kl_xssl numeric(12,4),
kl_dhsl numeric(12,4),
kl_dcsl numeric(12,4),
kl_thsl numeric(12,4),
kl_zfcsl numeric(12,4),
kl_jcsl numeric(12,4)
)
set nocount on
declare cursor_kc_ck cursor local
for
select kc_ck.ckdm from kc_ck
open cursor_kc_ck
declare @ckdm varchar(4)
fetch cursor_kc_ck into @ckdm
while @@fetch_status=0
begin
insert into #Temp_kljc_fl