Detach a TFS Project Collection when the database doesn't exist
Try repairing the db
dbcc checkdb ('TfsVersionControl',repair)
as found on: http://dotnet.dzone.com/news/database-corruption-tfs-2005?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fcss+%28CSS+Zone%29
The best option is to delete the collection using below command.
syntax:TFSConfig Collection /delete /collectionName:[COLLECTION NAME]
TFSConfig Collection /delete /collectionName:Project( here project is name of the collection)
For example:
C:\Users> cd..
C:\> cd Program Files\Microsoft Team Foundation Server 2010\Tools
C:\Program Files\Microsoft Team Foundation Server 2010\Tools> TFSConfig Collection /delete /collectionName:Project
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_TPC_AT_0710_134506.log
Command: collection
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
Deleting a Team Project Collection is an irreversible operation. A deleted collection can not be reattached to the same or another Team Foundation Server. Are you sure you want to delete 'Project'? (Yes/No) y
Found Collection 'Project'. Deleting...
The delete of collection 'Project' succeeded.