Omid Shariati
Omid Shariati

Reputation: 1916

How to solve TFS error TF246021 and SQL Server error 500200 while checking in?

I'm trying to check in a file, and one file (one and only one file) has a problem while being checked in. This file has been deleted many times and undeleted (due to a conflict in architecture and design) and now TFS throws this error:

TF246021: An error occurred while processing your request. Technical information (for administrator): SQL Server Error: 500200

As we saw the log file of the Event Viewer, the problem is:

Violation of PRIMARY KEY constraint 'PK_tbl_PendingDelta'. Cannot insert duplicate key in object 'dbo.tbl_PendingDelta'.

However, there is no pending changes in dbo.tbl_PendingDelta. In fact, this table is completely empty. What's wrong here? How can I solve this problem?

Upvotes: 19

Views: 14821

Answers (7)

Jamshaid K.
Jamshaid K.

Reputation: 4587

In my case, a file that I had deleted was causing the problem. On Go Online file selection dialog, I unchecked the culprit file and the project was successfully made online.

Update

Just noticed the error code is slightly different in op's question. Mine was showing an error code as SQL Server Error: 18054.

Upvotes: 0

Masum Billah
Masum Billah

Reputation: 41

1.From the File menu, click Source Control, and then click Workspaces.

2.In Manage Workspaces dialog box, under the Name column, highlight the workspace that you want to remove, and then click Remove.

3.In the Confirmation dialog box, click OK.

your work is done.

And map your solution again then you can work properly.

Upvotes: 4

user2000095-tim
user2000095-tim

Reputation: 446

I renamed my workspace folder (the top level containing $tf) then did a get latest on the branch I wanted, then the unshelve worked.

Upvotes: 1

Scott Munro
Scott Munro

Reputation: 13596

This seems to be related to the workspace. I had this problem on one workspace but was able to perform the source control operation that triggered the error (rollback a previous rollback) in a different workspace without any problems.

Recreating your workspace might be a solution.

Upvotes: 10

Bindum
Bindum

Reputation: 91

I had something similar happen. Previously I had rolled back some changes and was reintroducing those changes in the solution and project files again with the same name. The problem that I found was a sql script rename was not in the Sql.proj file and I needed to add it and then close the solution to accept the changes to the proj file. Once I corrected the rename, made sure that it was in the project file, then I could check it in.

Upvotes: 1

LosManos
LosManos

Reputation: 7692

My solution was to exclude the culprit and check in the rest.
I then checked in the culprit.

( If you have a gated checkin you might have to turn that off first. )

Upvotes: 3

Mike Dimmick
Mike Dimmick

Reputation: 9802

I suspect that somehow the items in the change set use the same ID twice, so the first INSERT is fine but the second will cause the violation. However, since they're in the same transaction, the first INSERT is rolled back and you don't see anything in tbl_PendingDelta afterwards.

See http://connect.microsoft.com/VisualStudio/feedback/details/693450/tfs-2010-violation-of-primary-key-constraint-pk-tbl-pendingdelta for another example of this issue.

I think you should take this up with Microsoft Product Support Services.

Upvotes: 1

Related Questions