Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

Subscription getting a Time out error

$
0
0
I have a report with 4 subscriptions for emailing the report at 4 different times a day. its data driven running the following script:[code="sql"]DECLARE @WaitForTime datetimeDECLARE @StopWaitTime datetimeDECLARE @WaitIncrement intDECLARE @StopIncrement intDECLARE @PackageRetVal intDECLARE @ReturnValue intSET @ReturnValue = 0SET @WaitIncrement = 5SET @StopIncrement = 90SET @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())ENDSELECT TodaysDate = getdate()SELECT Results = @ReturnValue[/code]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 errorError: 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?

Viewing all articles
Browse latest Browse all 2791

Trending Articles