Can I access the SQL server databases directly?
I have found the following database files in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
STS_team-foundation_1.mdf
TfsBuild.mdf
TfsWarehouse.mdf
tfsWorkItemTrackin.mdf ->this was what i was looking for
My problem is that I can't seem to access the database using the visual studio "connect to database" tool. I tried all three of the user that were created for the server setup(tfsSetup, tfsReports, tfsService) to no avail.
I was looking for a way to program a web interface to view, edit and add work items.
Anyone got some pointers?
Thanks in advance!
I suspect the reason you can't access them has to do with SQLServer security configuration. That said, I strongly advise you not to try to read or write those tables directly. The business logic that sits in front of them to ensure correctness and consistency is substantial.
We have designed our object model to be used on a web server for exactly this purpose. I would recommend that you use that to create your web application.
Brian
Would it be at all useful to interact with said SQL tables in a strictly read-only fashion, or is it possible to perform pretty complex operations with the object model? For example, I might want to ensure that all SQL code stored in TFS matches the code compiled in a production SQL Server -- this would let me know if anyone's been naughty and modified code via Enterprise Manager instead of going through source control. (I assume it is not too hard to implement logic that executes SQL code checked in against a database, so that one doesn't have to commit code to source control and compile it on on the database?)
In general we strongly recommend people use the object model for accessing the operational store. The warehouse can be accessed directly using SQL. There are a variety of reasons for this - including the fact that we will change the schema over time and break you.
I can't understand exactly what you are asking (particularly in the parenthesized sentence at the end). One thing to keep in mind is that when TFS stores files, they are compressed and old versions are deltas. This means that it's impractical to use anything but the OM to manipulate them.
Brian
I understand what you are saying.
What would be ideal for our company would be a source-control checkin "trigger" which automatically compiles SQL code against the correct database when it is checked in. Therefore, the work done to use source control vs. editing in Enterprise Manager directly is comparable. What we would want to do is have an integrity check to ensure that the code currently in SQL Server matches the code in source control.
The main worry is that it might be hard to interact with TFS in ways as easy as it is to access SQL Server. For example, it would be very nice to be able to run SQL statements against the Exchange Information Store, return resultsets, etc.; this is either impossible or hard to do. I know one can use WebDAV and the EXOLEDB provider, but those aren't documented that well. From what I gather, this won't be a problem in TFS. Is this correct?
Buck Hodges has provided
information on the TFS API -- is it available online anywhere, or must I download it? I would like to know if there are any API's that come in the form of table-valued UDF's or views, such that I could integrate TFS with a MSSQL-resident CMS that I am developing on the database layer level. We're building an integrated documentation system and the big missing link is a source control solution.