If you run an explicit UPDATE STATISTICS command against the same table from two different connections at the same time, the two connections may deadlock. One of the connections receives the following error message, and its UPDATE STATISTICS command is canceled:
Server: Msg 1205, Level 13, State 50, Line 3 Transaction (Process ID 52) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Deadlocks and their accompanying 1205 errors are not unique to this situation. Deadlocks may also occur in many other, unrelated scenarios. If you enable trace flag 1204 to capture more details about this particular deadlock, you see the two connections deadlocked on clustered index KEY resources on the sysindexes table (object ID 2). One of the two connections tries to convert a shared lock to an update lock, and trace flag 1204 output reports the statement type for both connections as UPDATE STATISTICS.
Service pack information
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 How to obtain the latest SQL Server 2000 service pack
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.
This fix is SQL Server build number 851, and it can only be applied to a computer that is running SQL Server 2000 Service Pack 3 (SP3) or a hotfix build that is based on SQL Server SP3.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 4.
To work around this problem, do not run UPDATE STATISTICS from two connections at the same time against the same table.
This problem only occurs for explicit UPDATE STATISTICS commands or for the sp_updatestats stored procedure. (The sp_updatestats stored procedure runs UPDATE STATISTICS.) This problem does not occur because of the auto update statistics or the auto create statistics database options or because of explicit CREATE STATISTICS commands. This hotfix serializes UPDATE STATISTICS commands that act on the same table, in the same way that statistics creation and auto update statistics events are already serialized.