Visual Studio Team System – Database Project won’t compile
We use Database Projects to keep multiple versions of our databases in sync (both schema and data). Lately I’ve encountered several annoying build errors. The cause for all of them seemed to be related to the fact that the validation database had gotten out of sync.
Partial error message (so that SE can pick it up): Error 7 TSD7031: An object with name already exists in the database project…
Solution:
- Close the database project.
- If the validation database is still present on the server, delete it. (The name of the database is ProjectName_GUID, where ProjectName is the name of the database project)
- Delete the ProjectName.dat file.
- Reopen the database project.