How to limit download attempts in packages.

Use SQL management studio to run the following query and limit download attempts to 2. Change 2 to anything you want at the end of the query.

use ProvidusDB
go
ALTER PROCEDURE dbo.usp_GetNonDownloadedDocs  
@JobId char(36),
@TaskId char(36),
@JobStartTime datetime
AS
SELECT     doc_id, uri, temp_uri, copy_completion_code, copy_completion_time, doc_start_time, doc_completion_time, copy_try_count
FROM         task_instance_docs
WHERE     (job_id = @JobId)  AND  (task_id = @TaskId) AND (job_start_time = @JobStartTime) AND 
                      (copy_completion_code <> 'Success') AND  (copy_try_count < 2)