Primafact: Determine Document Page Distribution

Primafact: Determine Document Page Distribution

The following SQL query can be run against the Primafact database to determine the number of documents with each page count.
When you run the query, you will see results like this:



The example above indicates that there are 2 documents that have between 28,300 and 28,400 pages.

You should size the computer you are using for the migration appropriately to ensure it can handle all documents of the specified sizes.


  1. DECLARE @RANGE INT = 100

  2. SELECT
  3. Pages_From = (CEILING(PageCount / @RANGE) * @RANGE),
  4. Pages_Till = (CEILING(PageCount / @RANGE) * @RANGE) + @RANGE,
  5. Docs = COUNT(*)
  6. FROM
  7. (
  8. SELECT TOP 999999999
  9. DocId,
  10. PageCount = Count(*)
  11. FROM
  12. _Pages
  13. GROUP BY
  14. DocId
  15. ORDER BY
  16. PageCount DESC

  17. ) PageCounts
  18. GROUP BY
  19. (CEILING(PageCount / @RANGE) * @RANGE)
  20. ORDER BY
  21. Pages_From DESC

    • Related Articles

    • Primafact: Document Synthesis

      How Primafact is Designed to be Used Primafact is not a document management system. While Primafact does store documents, Primafact is a Litigation Document Management System, not a standard document management system. It is designed to ingest large ...
    • Primafact: Preparing Documents for Backup

      Mapping Matters Prior to backing up documents from Primafact, each yellow folder that represents a matter should be converted to an actual matter folder. To do this, log into Primafact and find yellow folders that represent matters: Right-Click on ...
    • NetDocuments: Copy Documents to Clio Document storage from Clio integration linked folders

      Clio has an integration with NetDocuments that creates folders in NetDocuments linked to Matters in Clio. If a client making use of this integration wants to move their documents from NetDocuments to being stored in Clio you can use this procedure. ...
    • Extracting Document Metadata from ndToolkit

      NdToolkit is a tool from NetDocuments used by consultants, to extract data from repositories/cabinets. It can be used to extract the Metadata from the Cabinet for Workspaces, Folders and Documnets. To accomplish this, do the following: Open ndToolkit ...
    • Salesforce Document Backups: Special Permissions

      By default, in the Salesforce API, a user only has permission to download documents that they have uploaded themselves. In order to create a reliable backup of all documents, special permissions must be created. Create a Permission Set that Allows ...