May 18, 2005 at 7:00 pm
Thanks in advance for your feedback! Here's the case.
Users notice missing data in their application when not using the delete button (stored procedure). I created a trigger to capture this missing data and it revealed through the transaction log that SQL Server was cleaning up deleted rows from the indexes/pages. The developer has to go back in and put these rows back in the table but has noticed every time these deletes are reinserted, SQL Server deletes another batch with the same ones from the previous time. So this started at 85 rows and over the week has grown to 3500 rows of deletes by appending undos and adding new ones. The stored procedure has been used for over a year with no problems and works daily when users need to edit content.
I can see in the transaction log the deleted rows since they are marked as ghost and done in one transaction. I have used profile to create a trace but have missed these occurrences.
What more can I do to help pin point the cause of deletes that the developer says should not be deleted at all? Meaning, the users are not initiating the delete function in the application.
May 19, 2005 at 10:28 am
Can you post your DELETE code?
I wasn't born stupid - I had to study.
May 19, 2005 at 10:47 am
CREATE PROCEDURE del_showcode
@NumId int,
@TagId int,
@PartDel bit OUTPUT
AS
DELETE tableNameA WHERE (colNameC IS NULL) AND (TagID = @TagId)
DECLARE @Count Int
SELECT @Count = count(*) FROM tableNameA WHERE NumId = @NumID
IF @Count = 0
BEGIN
DELETE tableNameB WHERE (NumId = @NumId)
SET @PartDel = 1
END
ELSE
SET @PartDel = 0
RETURN @PartDel
May 19 2005 12:36PM 1
May 19 2005 12:33PM 1
May 19 2005 11:49AM 1
May 19 2005 10:49AM 7
May 19 2005 10:03AM 2
May 19 2005 8:24AM 2
May 19 2005 8:02AM 12
May 19 2005 7:53AM 1
May 18 2005 11:46AM 3312
May 18 2005 11:20AM 1
May 18 2005 10:58AM 1
May 18 2005 10:11AM 2
May 18 2005 8:55AM 12
May 18 2005 5:41PM 12
May 18 2005 5:40PM 6
May 18 2005 5:22PM 6
May 18 2005 5:20PM 6
May 18 2005 4:43PM 1
May 18 2005 4:33PM 7
May 18 2005 4:00PM 3
May 18 2005 3:53PM 1
May 18 2005 3:18PM 3349
May 18 2005 3:05PM
May 19, 2005 at 11:30 am
I'd be looking at anything and everything that has been changed in the application at the time that this started. Its got to be something in the application doing this. I would also recommend using profiler to identify where the deletes are coming from. This seems serious enough to not worry about the overhead that profiler causes. Just try to narrow your trace enough that you don't fill your disk with the trace info, and let it run until the next occurence. Identify the users that are in the system at the time the delete occurs, and ask them what EXACTLY they did. Then isolate them, and have them do it again. You should be able to identify what user caused it, and what parts of the application they were executing at the time. Then you can look for misplaced/malformed delete statements.
Steve
May 22, 2005 at 12:01 pm
could it be that when the procedure is called, @NumId is null, and produces unpredicatable results, like deleting everything?just a thought.
Lowell
June 11, 2005 at 9:29 pm
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply