Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Subscription getting a Time out error


Subscription getting a Time out error

Author
Message
dndaughtery
dndaughtery
SSC-Addicted
SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)

Group: General Forum Members
Points: 456 Visits: 1071
I have a report with 4 subscriptions for emailing the report at 4 different times a day. its data driven running the following script:


DECLARE @WaitForTime  datetime
DECLARE @StopWaitTime datetime
DECLARE @WaitIncrement int
DECLARE @StopIncrement int
DECLARE @PackageRetVal int
DECLARE @ReturnValue int

SET @ReturnValue = 0
SET @WaitIncrement = 5
SET @StopIncrement = 90
SET @WaitForTime = DATEADD(minute, @WaitIncrement, getdate())
SET @StopWaitTime = DATEADD(minute, @StopIncrement, getdate())

WHILE (@WaitForTime < @StopWaitTime)
BEGIN
   SELECT top 1 @PackageRetVal = DataCode
   FROM dbo.sysssislog (NOLOCK)
   WHERE   source like 'Import_SQLPlexStaging_Statusmart_DailyApps'
   AND      [event] = 'PackageEnd'
   AND      DATEDIFF(mi, StartTime, getdate()) < 90
   ORDER BY ID desc

   IF @PackageRetVal is not null
   BEGIN
      IF @PackageRetVal = 0 -- no error
         SET @ReturnValue = 1
      ELSE
         SET @ReturnValue = 0
         
      BREAK
   END

   IF (getdate() >= @StopWaitTime)
    BEGIN
      SET @ReturnValue = 0 -- timed out
      BREAK
    END

    WAITFOR Time @WaitForTime
   
    SET @WaitForTime = DATEADD(minute, @WaitIncrement, getdate())
END

SELECT TodaysDate = getdate()

SELECT Results = @ReturnValue



I can set it to execute a minte from my current time for testing and it runs fine and emails the report but when I scheddule it for the time it needs o run I get the following error

Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Does anyone know how I can fix it?
dndaughtery
dndaughtery
SSC-Addicted
SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)

Group: General Forum Members
Points: 456 Visits: 1071
I figured it out. In my code there is a wait command that occasionally is called. I changed the timeout setting in the subscription to 1200 and it ran fine.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search