v5.1.1: find the creation date of repository

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

Moderator: SourceGear

Post Reply
kha
Posts: 221
Joined: Fri Sep 12, 2008 8:25 am

v5.1.1: find the creation date of repository

Post by kha » Thu Aug 04, 2011 11:56 am

Hi,

I would like to find the creation date of the repositories. Instead of running the history of each repository, is there a way I can find that using sql script? If so, can you please let me know which table and which column i should look at? :?:

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: v5.1.1: find the creation date of repository

Post by lbauer » Thu Aug 04, 2011 12:46 pm

It might be possible to write a SQL script. I'm not sure what kind of query you could write, but the information you need is in the sgvault dbo.tbltransactions and in dbo.tblrepositories.

In dbo.tbltransactions you can look for the earliest transaction per repid, which would be the creation date, then find the repository name for that repid in dbo.tblrepositories.
Linda Bauer
SourceGear
Technical Support Manager

kha
Posts: 221
Joined: Fri Sep 12, 2008 8:25 am

Re: v5.1.1: find the creation date of repository

Post by kha » Thu Aug 04, 2011 1:23 pm

Hi Linda,

I thought transaction table will show every single transaction (including check in, deletion, creation, etc.), not just only repository creation.

I just need the new repository that created last month, i don't need to know all activities that happened last month.

Transactions table doesn't show details what kind of action that happened, it only shows txbegin and txend.

I found out that I have to do it in multiple steps by
- querying the transactions tbl, repositories tbl, then get the txid smallest from the result
- querying the transactionattrvalues tbl where [attrvalue] = 'creating repository' AND [txid] >= the smallest number that i got from above query
- then go from there :D

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: v5.1.1: find the creation date of repository

Post by lbauer » Fri Aug 05, 2011 3:34 pm

Transactions table doesn't show details what kind of action that happened, it only shows txbegin and txend.
That's true, though the very first transaction for a particular repid is the creation of the repository. At least that's what I found when I created a new repository and looked at the transations table.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply