Prioritizing documents based on different criteria

Prioritizing documents based on different criteria

The following scripts provide examples that can be modified to apply different priorities to documents. 


Prioritize Large/Small Documents

If you are restoring into a system that has different action limits at different times, this can help you optimize throughout.

Big documents should be prioritized when action limits are small and small documents should be prioritized when action limits are big.

  1. --Prioritize documents based on size.
  2. UPDATE
  3. __M_Documents_Digital_Files
  4. SET
  5. Batch_Number = -100
  6. WHERE 1=1
  7. AND Id IN (
  8. SELECT
  9. Final_DocumentFile_Id
  10. FROM
  11. __M_Documents_Digital_Files_Versions
  12. WHERE 1=1
  13. --Change this to be < or > depending on what you want.
  14. AND Final_ContentSize < 10 * 1024 * 1024 -- 10MB
  15. AND Result_Id = ''
  16. )


Prioritize Documents for Open Matters

When restoringg giant amounts of documents, it can be helpful to firms if documents for open matters get transferred first.  This script does that.

  1. --Prioritize documents for open matters.
  2. UPDATE
  3. __M_Documents_Digital_Files
  4. SET
  5. Batch_Number = -100
  6. WHERE 1=1
  7. AND Result_Id = ''
  8. AND Final_Parent_Id IN (
  9. SELECT
  10. Id
  11. FROM
  12. __M_Matters
  13. WHERE 1=1
  14. AND Final_Status = 'Active'
  15. )


Prioritize Documents for Specific Matters

  1. --Prioritize documents for specific matters.
  2. UPDATE
  3. __M_Documents_Digital_Files
  4. SET
  5. Batch_Number = -100
  6. WHERE 1=1
  7. AND Result_Id = ''
  8. AND Final_Parent_Id IN (
  9. SELECT
  10. Id
  11. FROM
  12. __M_Matters
  13. WHERE 1=1
  14. AND Final_ReferenceCode IN (
  15. 'ABC-001',
  16. 'ABC-002'
  17. )
  18. )


Prioritize Documents whose versions have not been fully uploaded

  1. UPDATE
  2. __M_Documents_Digital_Files
  3. SET
  4. Batch_Number = -1
  5. WHERE 1=1
  6. AND Id IN (
  7. SELECT
  8. Final_DocumentFile_Id
  9. FROM
  10. __M_Documents_Digital_Files_Versions
  11. WHERE
  12. Result_Id = ''
  13. )


Prioritize Documents that have not been started

  1. UPDATE
  2. __M_Documents_Digital_Files
  3. SET
  4. Batch_Number = -1
  5. WHERE 1=1
  6. AND Result_Id = ''
 

    • Related Articles

    • Synthesize: Missing Document Categories for Documents

      The following script will synthesize document categories for invalid Final_DocumentCategory_Id values on documents. -- Some documents are linked to categories that no longer exist. -- Create dummy document categories based on these values. INSERT ...
    • Synthesize Missing Matters for Documents

      Some systems only allow documents to be linked to matters. These scripts will allow you to restore data into these systems. When Matters No Longer Exist The following script with synthesize matters for document related to matters that no longer ...
    • Prioritize documents for Active (Open) Matters

      --Prioritize documents for Active (Open) Matters UPDATE __M_Documents_Digital_Files SET Batch_Group = -100 FROM __M_Documents_Digital_Files V1, __M_Matters V2 WHERE 1=1 AND V1.Final_Parent_Id = V2.Id AND V1.Final_Parent_Type = '__M_Matters' AND ...
    • Set a Default Folder for Documents

      --The following script will place all documents that are directly in a root folder inside of a subfolder. UPDATE __M_Documents_Digital_Files SET --Change this to be whatever subfolder we want it to be. Final_FolderName = '\Unfiled\' WHERE ...
    • Document Register: Moving digital documents into a Document Register Matter

      /* This script is a template that will help you move library documents (document register / safe custody records) into a general 'Document Register' matter. You should consider this a TEMPLATE that you may want to tweak and adjust for each client's ...