Querying SQL database for builds

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
bbohlen
Posts: 2
Joined: Mon Jun 21, 2004 4:42 pm

Querying SQL database for builds

Post by bbohlen » Wed Jun 30, 2004 10:35 am

Hello, we are working with Vault in a J2EE shop. Our development environment is directly tied to Vault with Shadow Folders. We are trying to come up with a scheme to create nightly builds to our Test and Production environments based on versioning or other status information in Vault.
My question is: would there be any way to use SQL or DTS to query the Vault database for the names and locations of files that match a certain version # or have certain text in an attribute?
This way, the DTS script could create a text file listing all of the files that needed to be copied over to Test and production.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Jun 30, 2004 10:05 pm

would there be any way to use SQL or DTS to query the Vault database for the names and locations of files that match a certain version # or have certain text in an attribute?
This might be rather difficult to do. It can be done, but the success depends on your knowledge of the schema and SQL Server itself.

Look at the results from :
SELECT * FROM sgvault.dbo.ufngettreestructure( @@SOME_REPID, -1 ) ORDER BY treelevel, parentpathhash

This will give you the current tree for a given repository id (from tblrepositories). If you want to find how the tree looked yesterday, you could issue the same select statement from above, but use an actual transaction id from yesterday instead of -1.

Note the full paths to items are not stored, so you would have to iterate of the result set, concatenating parent to child ( joining on treelevel = treelevel + 1 and fullpathhash = parentpathhash )

You could search the results from this query to find what you are looking for.
Jeff Clausius
SourceGear

Post Reply