TFS 2012 - TF400013: An unexpected database error occurred

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:45:48

问题


I have critical problem: I have a TeamProjectCollection. In this collection i had a project. And i need re-create project with same same. I delete this project and create project again. After this i get next error on TFS:

This error apear whe i try to open any project from this collection. How can i fix this?


回答1:


Probably too late to help OP, ... But for any others running into this 'TF400013: An unexpected database error occured' here is how I resolved it on my TFS2013 system.

  1. Launch the Microsoft SQL Server Management Studio (SMS) on the TFS server from an Administrator's account.
  2. From SMS's top level menu Launch the [Tools|SQL Server Profiler]
  3. When prompted for the [Trace Properties] select TSQL for the [Use the template:] combo box; as the default will generally only show you 'encrypted text' in the [TextData] column.
  4. Perform the offending action. In my case I was listing the high-level [TEST] page for a project from the TFS Web Application.
  5. Stop the trace in the SQL Profiler and sift through the related [TextData] column to find the offending SQL that is generating the 'unexpected database error'.
  6. This can be accomplished by copying the [TextData] SQL from the SQL Profiler to a Query window in SMS. You might have to add a USE Tfs_xxx, where xxx is replaced by your [Team Project Collection] name. Note that some queries are intended to be run with the preceding SQL of USE Tfs_TFSConfiguration, identifying the TFSConfiguration database instead of the project collection database.
  7. You can play with the offending SQL in SMS to remedy for the 'unexpected database error', get better diagnostic error messages, and gain the possible insight needed to make the UI or database correction to your TFS system.

!!! BEWARE that any changes by you to the TFS database from SMS will void your Microsoft TFS Support Agreement. !!!

On my system the TFS [TEST] Web application broke because someone (me) added a [Column option] (from the page's UI) to the page's query that was listed in the dialog, but obviously not supported. The datatable query for the page failed from an internal database error for an 'Invalid column name'. In the SQL Profiler, ahead of the datatable fill SQL, there was a query for the columns to display which included the offending 'unknown column name' in the SQL result:

exec prc_QueryRegistry
 @partitionId=1
,@registryPath=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\'

The quickest fix for me, voiding my non-existant Microsoft TFS support agreement, was to clear this column setting by executing the following SQL in SMS

exec prc_SetRegistryValue @partitionId=1
,@key=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\'
,@value=''
,@identityName='your name here'


来源:https://stackoverflow.com/questions/13916425/tfs-2012-tf400013-an-unexpected-database-error-occurred

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!