Is it possible to query the database to get details of each Project, number of Files & Sizes?

0 Likes

Problem:

Is it possible to query the database to get details of each Project, number of Files & Sizes?

Resolution:


  • Product Name: StarTeam
  • Product Version: All
  • Product Component: SQL / Database
  • Platform/OS Version: All


The following query will return details of each project, number of files and sizes?

SELECT
ProjectID AS "Project ID",
ViewID AS "View ID",
SUM(filesize) AS "Total File Size",
COUNT(projectid) AS "Total Amount of Files"
FROM
syn_File
WHERE
EndModifiedTime = 0 AND -- counts "tip" revisions only
(DeletedTime = 0 and DeletedUserID = -1) -- make sure it is not marked as "deleted"
GROUP BY ProjectID, ViewID
ORDER BY ProjectID, ViewID


This query will total only current or "tip" revisions, of the files. Previous revisions are not totalled as this will cause a discrepancy in file size total. Also, any "deleted", but not yet purged, files are also not counted.


Old KB# 29383
Comment List
Related
Recommended