When Visual Studio Team System Database Edition opens a design-time validation database, it acquires an exclusive application lock on the DesignDB database using the following code.
1: EXEC @rc = sp_getapplock N'TSDATA', N'Exclusive', N'Session', 0, N'dbo';
A side effect of acquiring the application lock is that only a single Visual Studio instance can open the project using the same DesignDB instance, this is why the DesignDB name is stored in the <database project>.dbproj.user file which therefore should not be shared between. If you do share the <database project>.dbproj.user file and a second user will try to open the project it will get the following error dialog, indicating that the DesignDB instance associated with the project is already open.
You can use this knowledge to find out which DesignDB instances are actively being used by a Visual Studio instance by running the following query:
If you have multiple instances of Visual Studio running and want to find out which process is holding an DesignDB instance open you can correlate it back to the process ID (PID) by using the following query: