Forum Discussion

Michael_Buehlme's avatar
11 years ago

SQL-Query listing ArchiveName, ArchivedItems, ArchivedItemsSize, YoungestArchivedDateUTC

I have a SQL-Query which generates a list of Archives with ArchiveName, ArchivedItems, ArchivedItemsSize.

USE EVVAULTSTORENUE
GO

SELECT [ArchiveName], ArchivedItems,
    CAST(ArchivedItemsSize AS decimal(20, 0)) AS ArchivedItemsSize
FROM view_ListVaults
INNER JOIN [EnterpriseVaultDirectory].[dbo].[ArchiveView]
ON view_ListVaults.ArchivePointId = [EnterpriseVaultDirectory].[dbo].[ArchiveView].[VaultEntryId]

order by [archivename] asc

 

How can I get the "YoungestArchivedDateUTC" to the list?

  • Hello Michael,

    You need to use the IndexVolumeView from the EVDir DB. Try this one:

    USE EVVAULTSTORENUE
    GO

    SELECT [EnterpriseVaultDirectory].[dbo].[ArchiveView].[ArchiveName], ArchivedItems,
        CAST(ArchivedItemsSize AS decimal(20, 0)) AS ArchivedItemsSize, IndexVolumeView.YoungestArchivedDateUTC
    FROM view_ListVaults
    INNER JOIN [EnterpriseVaultDirectory].[dbo].[ArchiveView]
    ON view_ListVaults.ArchivePointId = [EnterpriseVaultDirectory].[dbo].[ArchiveView].[VaultEntryId] INNER JOIN [EnterpriseVaultDirectory].[dbo].[IndexVolumeView] ON [EnterpriseVaultDirectory].[dbo].[ArchiveView].[VaultEntryId] = [EnterpriseVaultDirectory].[dbo].[IndexVolumeView].[VaultEntryId]