Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing query doesn't stop
Message
 
 
To
17/06/2008 11:13:46
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
Scripting
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324607
Message ID:
01324768
Views:
11
As I tried to say to you, move the last

FETCH NEXT
FROM PAGE
INTO
@PATH ,
@Filename,
@PAGE

right before the last END.

>>This particular code is a bit too complcated. What exactly you're trying to do and is it possible to avoid cursors (performers killers) at all for your task?
>>
>>>Ok, that helped with another issue I was having, but it still doesn't keep the query from hanging up.
>>>
>
>The code works great, other than the current problem.
>
>Below is a block of code. It looks like the last PRINT ('Page Cursor (bottom fetch): ') is repeating over and over again after it gets to a certain
> point. Does this have to do with the @@Fetch_Status variable? Makes me wonder if the 2nd FETCH is screwing up the loop for the first one.
>
>
>				FETCH NEXT
>					FROM PAGE
>					INTO
>						@PATH ,
>						@Filename,
>						@PAGE
>
>PRINT 'Page Cursor (top fetch): ' + @Path + ' ' + @Filename + ' ' + @Page
>
>				WHILE @@FETCH_STATUS = 0
>
>					BEGIN
>
>						IF @Filename COLLATE Latin1_General_CI_AI LIKE '%.TIF%' COLLATE Latin1_General_CI_AI
>
>							BEGIN
>
>								IF @PAGE = 1
>
>									BEGIN
>
>										SET @Export_FileName = @Filename
>										-- Currently G:\TCimages and F:\Images1 on client box
>										SET @Merge_Script = 'c:\ImpactMD\Images\' + @PATH + @Filename + ','
>
>									END
>
>								IF @PAGE <> 1
>
>									BEGIN
>
>										SET @Merge_Script = @Merge_Script + 'c:\ImpactMD\Images\' + @PATH + @Filename + ','
>
>									END
>
>										FETCH NEXT
>											FROM PAGE
>											INTO
>												@PATH ,
>												@Filename,
>												@PAGE
>
>							END
>
>PRINT 'Page Cursor (bottom fetch): ' + @Path + ' ' + @Filename + ' ' + @Page
>
>					END
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform