Microsoft KB Archive/934005

= How to configure SQL Server 2005 to avoid automatic escalation to table locks after a large user operation occurs against Visual Studio 2005 Team Foundation Server =

Article ID: 934005

Article Last Modified on 4/30/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Team Foundation Server

-



INTRODUCTION
A large user operation against Microsoft Visual Studio 2005 Team Foundation Server may cause the Microsoft SQL Server 2005 Database Engine to escalate to a table lock. Typically, this behavior occurs during large source code control operations.

For example, a large source-code control operation involves checking in approximately 5,000 files. As soon as an operation acquires 5,000 individual locks, the Database Engine automatically escalates the locks to a table lock. This table lock blocks all access to the table. This blocked access includes unrelated table access. For example, simple read operations and simple get operations cannot access the table.

This article describes how to configure SQL Server 2005 to avoid automatic escalation to table locks after an operation acquires 5,000 individual locks.



MORE INFORMATION
If you experience the issue that is described in the &quot;Introduction&quot; section, you can configure SQL Server not to escalate individual locks into a table lock.

To do this, follow these steps.

Note You may experience an out-of-lock memory exception when you disable lock escalation for large operations on a 32-bit computer.  Disable lock escalation. To do this, follow these steps  Click Start, click Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Configuration Manager. Click SQL Server 2005 Services, right-click SQL Server , and then click Properties.  Click the Advanced tab, and then add the following line of code to the end of the Startup Parameters string: ;-T1211  Click OK to close the SQL Server Properties dialog box. Click SQL Server 2005 Services, right-click SQL Server , and then click Restart. </li> Disable row locking on the tbl_PendingChange table and the tbl_LocalVersion table. To do this, follow these steps:  Click Start, click Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio.</li> Expand Database, right-click TfsVersionControl, and then click New Query.</li>  Add the following code example to the new query windows. EXEC sp_indexoption N'tbl_LocalVersion.PK_tbl_LocalVersion', N'DisAllowRowLocks', TRUE;

EXEC sp_indexoption N'tbl_LocalVersion.IX_tbl_LocalVersion_WorkspaceId_LocalItem', N'DisAllowRowLocks', TRUE;

EXEC sp_indexoption N'tbl_PendingChange.PK_tbl_PendingChange', N'DisAllowRowLocks', TRUE;

EXEC sp_indexoption N'tbl_PendingChange.IX_tbl_PendingChange_TargetServerItem', N'DisAllowRowLocks', TRUE;

EXEC sp_indexoption N'tbl_PendingChange.IX_tbl_PendingChange_ItemId_WorkspaceId', N'DisAllowRowLocks', TRUE; </li> Click Execute.</li></ol> </li></ol>

Additional query words: TFS SQL2005 vs2005

Keywords: kbcode kbinfo kbhowto KB934005

-

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

© Microsoft Corporation. All rights reserved.