Microsoft KB Archive/176684

= FIX: Msdb..Syshistory Rows May Be Incorrectly Deleted =

Article ID: 176684

Article Last Modified on 3/14/2006

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q176684



BUG #: 16236 (6.5)



SYMPTOMS
The task history is maintained for all tasks in the MSDB database. When the maximum number of rows of any given task is reached, the historical rows of that task should be deleted in sequence, starting with the oldest row. However, the INSERT trigger on the syshistory table may remove historical information in an incorrect order.



CAUSE
The problem is in the INSERT trigger for the syshistory table that removes the older rows when the maximum number of records is exceeded. The DELETE statement used to remove the records can delete the wrong record when a non- clustered index (instead of the clustered index) is used by SQL Server to complete the removal.

SET ROWCOUNT is used with the DELETE statement to remove a specified number of sequential records. Depending on index sort order, different rows can be removed.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Additional query words: sqlexecutive

Keywords: kbbug kbfix kbusage KB176684

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.