|
Posted by Erland Sommarskog on 05/26/05 09:57
coosa (coosa76@gmail.com) writes:
> Beside, the trigger code is modfied now, still i run into hanging in
> run time due too the loop.
Of course:
> WHILE @TEMP_ID IS NOT NULL
> BEGIN
> SELECT @TEMP_ID = @P_ID,
> @COUNTER = @COUNTER + 1
> FROM INSERTED
> IF @TEMP_ID IS NULL
> BREAK
> END
INSERTED is not changing for the duration of the the trigger, so this is
indeed an infinite loop. You are reading the same ID over and over
again.
I repeat the request from the previous post:
The standard recomendation is that you post:
o CREATE TABLE statement for your table(s), possibly simplified.
o INSERT statements with sample data.
o The desired result given the sample.
o A short narrative that explains what you are trying to achieve from
a busniess-rules perspective.
In another post, you said:
> i did, check my table and other replies from begin of this post
CREATE TABLE was there, but the other points on my list are missing.
Of course, it is up to you, since you are the one who is asking for
help. If you prefer that people help you based only on guesses on
what you are trying to do and why, the quality of the response will
be in par with this. If we don't know what you want to do, we can't
tell you how to do it.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|