L
luckfeast
Unregistered / Unconfirmed
GUEST, unregistred user!
我有1个存储过程,在delphi中调用,我本人的笔记本电脑执行成功(win2000 pro+sql-server2000),
在服务器却执行失败(nt4.0+sql-server7.0),但如果直接在服务器的sql-serve的查询分析器中执行则一切正常,
请问这是什么原因?谢谢了,各位!
1)数据库版本问题,
2)程序问题
存储过程代码如下:
CREATE PROCEDURE zonghang AS
declare @jsq int
declare @bankno char(8)
declare @no1 char(10)
declare @zong varchar(1024)
set @zong = ''
declare lsmerg cursor for
select yhdm from inst_merg
for read only
open lsmerg
fetch lsmerg into @bankno
while @@fetch_status=0
begin
set @no1 = '%' + @bankno + '%'
select @jsq = count(*) from inst_merg where ltrim(rtrim(gxyh)) like (@no1)
if @jsq = 0
-- print @bankno
set @zong = ltrim(rtrim(@zong)) + @bankno
fetch lsmerg into @bankno
end
close lsmerg
deallocate lsmerg
if exists(select yhdm from inst_merg where yhdm='08350000')
update inst_merg set gxyh=@zong where yhdm='08350000'
else
insert into inst_merg (yhdm,gxyh) values('08350000', @zong)
GO
程序代码如下:
try
dmbbxtfrm.adospzh.Connection := dmbbxtfrm.gd_rpt;
dmbbxtfrm.adospzh.ProcedureName := 'zonghang';
dmbbxtfrm.adospzh.ExecProc;
except
application.MessageBox('application can not update information of 08350000 sql-server! ', 'application', mb_ok);
exit;
end;
在服务器却执行失败(nt4.0+sql-server7.0),但如果直接在服务器的sql-serve的查询分析器中执行则一切正常,
请问这是什么原因?谢谢了,各位!
1)数据库版本问题,
2)程序问题
存储过程代码如下:
CREATE PROCEDURE zonghang AS
declare @jsq int
declare @bankno char(8)
declare @no1 char(10)
declare @zong varchar(1024)
set @zong = ''
declare lsmerg cursor for
select yhdm from inst_merg
for read only
open lsmerg
fetch lsmerg into @bankno
while @@fetch_status=0
begin
set @no1 = '%' + @bankno + '%'
select @jsq = count(*) from inst_merg where ltrim(rtrim(gxyh)) like (@no1)
if @jsq = 0
-- print @bankno
set @zong = ltrim(rtrim(@zong)) + @bankno
fetch lsmerg into @bankno
end
close lsmerg
deallocate lsmerg
if exists(select yhdm from inst_merg where yhdm='08350000')
update inst_merg set gxyh=@zong where yhdm='08350000'
else
insert into inst_merg (yhdm,gxyh) values('08350000', @zong)
GO
程序代码如下:
try
dmbbxtfrm.adospzh.Connection := dmbbxtfrm.gd_rpt;
dmbbxtfrm.adospzh.ProcedureName := 'zonghang';
dmbbxtfrm.adospzh.ExecProc;
except
application.MessageBox('application can not update information of 08350000 sql-server! ', 'application', mb_ok);
exit;
end;