why stop when running sp at package???

shrikeng 2006-05-19 09:25:31
Dear all

i have a stored procedure which run in package. I find out that the stored

procedure stop at the running after 1 seconds, but the pacakage reports the

success.

this stored procedure can run at query analyzer normally.

I tried to adjust the command time-out at the execute sql task properties

object to 9999 or 0 or 1800. However, I find out it is useless to extend the

executive time.

The case happens in two sql server 2000 which is installed in win 2k server

and nt server 5.0. So, I guess it is a sql server bug.

Please give me some suggestion. whether a sql server has this bug? how can i

fix it?

thx
alex

------------------------------------------------------------
CREATE PROCEDURE usp_UpdateRGNUPC
AS
declare @upcVar varchar(13), @skuVar varchar(9), @strStore varchar(7), @tempSql varchar(1000)

declare varTempShop cursor
local
static
FOR select distinct Shop from strmst
OPEN varTempShop
fetch next from varTempShop into @strStore
while @@FETCH_STATUS = 0
begin
declare varTemp cursor
FOR SELECT r.upc, r.sku
FROM rgnupc r
INNER JOIN strmst s ON r.rgnid = s.rgnid
WHERE s.Shop = @strStore
OPEN varTemp
fetch next from varTemp into @upcVar, @skuVar
while @@FETCH_STATUS = 0
begin
set @tempSql = 'select * from ' + @strStore + '.dbo.invupc where upc = ''' + @upcVar + ''''
exec(@tempSql)

if (@@rowcount>0)
begin
set @tempSql = 'Update ' + @strStore + '.dbo.invupc set sku = ''' + @skuVar + ''' where upc = ''' + @upcVar + ''''
exec(@tempSql)
end
else
begin
set @tempSql = 'Insert into ' + @strStore + '.dbo.invupc (upc, sku) values (''' + @upcVar + ''',''' + @skuVar + ''')'
exec(@tempSql)
end


fetch next from varTemp into @upcVar, @skuVar
end
close varTemp
deallocate varTemp

fetch next from varTempShop into @strStore
end
close varTempShop
deallocate varTempShop
GO
...全文
110 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shrikeng 2006-05-22
  • 打赏
  • 举报
回复
my two server are
sql 2000 sp 4 at win nt 5.0 server
sql 2000 sp 3 at windows 2k server

they have the same problem
itblog 2006-05-20
  • 打赏
  • 举报
回复
:)
天地客人 2006-05-20
  • 打赏
  • 举报
回复
UP
OracleRoob 2006-05-19
  • 打赏
  • 举报
回复
Install the sp4 of the SQL Server 2000?

22,207

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧