04-02-2014 02:44 AM
Hi,
I'm looking for a way to display some archive information. I'd like to report on folders and the count of items in each.
I have the below to list the folders, which table/tables can I link to get an item count?
USE EnterpriseVaultDirectory SELECT * from ArchiveFolderView WHERE ArchiveVEID = 'UserArchiveID'
I'm guessing RootIdentity or VaultEntryID from the above can be used to join with another table and return a count?
Any help would be greatly appreciated.
Thanks
Solved! Go to Solution.
04-02-2014 03:50 AM
Ran following SQL query against VS database.
Select afv.FolderName, vt.VaultID Folder_id, ap.ArchivedItems, ap.ArchivedItemsSize 'Size(kb)' from ArchivePoint ap
inner join Vault vt on vt.ArchivePointIdentity = ap.ArchivePointIdentity
inner join EnterpriseVaultDirectory.dbo.ArchiveFolderView afv on afv.VaultEntryId = vt.VaultID
where ap.ArchivePointId = 'UserARchiveId'
04-02-2014 03:50 AM
Ran following SQL query against VS database.
Select afv.FolderName, vt.VaultID Folder_id, ap.ArchivedItems, ap.ArchivedItemsSize 'Size(kb)' from ArchivePoint ap
inner join Vault vt on vt.ArchivePointIdentity = ap.ArchivePointIdentity
inner join EnterpriseVaultDirectory.dbo.ArchiveFolderView afv on afv.VaultEntryId = vt.VaultID
where ap.ArchivePointId = 'UserARchiveId'
04-02-2014 04:54 AM
Thanks for the speedy response Pradeep.
I had to make a small change as it reported the overal archive size and items count for each folder, simply changed the 2 "ap." to "vt." in the Select line, as below in BOLD, and it's perfect.
Select afv.FolderName, vt.VaultID Folder_id, VT.ArchivedItems, VT.ArchivedItemsSize 'Size(kb)' from ArchivePoint ap inner join Vault vt on vt.ArchivePointIdentity = ap.ArchivePointIdentity inner join EnterpriseVaultDirectory.dbo.ArchiveFolderView afv on afv.VaultEntryId = vt.VaultID where ap.ArchivePointId = 'UserARchiveId'
Now to add the delimeters to the folder paths and sorted in order..... think I'll do this after exporting the results.
Thanks again.
04-02-2014 04:58 AM
Thanks, I just selected archivepoints alias. Many thanks for improving it.
04-02-2014 05:55 AM
For Information.
Updated T-SQL, formatted and removing aliases:
USE 'Vault Store DB' SELECT ArchiveFolderView.FolderName, ArchiveFolderView.FolderPath, Vault.VaultID, Vault.ArchivedItems 'Items', Vault.ArchivedItemsSize 'Size (KB)' FROM ArchivePoint INNER JOIN Vault on Vault.ArchivePointIdentity = ArchivePoint.ArchivePointIdentity INNER JOIN EnterpriseVaultDirectory.dbo.ArchiveFolderView on ArchiveFolderView.VaultEntryId = Vault.VaultID WHERE ArchivePoint.ArchivePointId = 'Archive ID'