Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Wait Untill the Value changes.

$
0
0

Hi,

  I have a group of subscription which I am executing one at a time thought cursor. It is working as expected. But it is executing all subscription simultaneously one by one. This will eat the server resources.

I need to wait until the first subscription complete. I found the LastStatus column in the Subscription table. I used below query and it is not working as expected.

WHILE

(select LastStatusfrom ReportServer.dbo.Subscriptionswhere SubscriptionID= @SubscriptionID)='Pending'

Begin

WAITFORDELAY'00:00:50'

Set @LastStatus=(select LastStatusfrom ReportServer.dbo.Subscriptionswhere SubscriptionID= @SubscriptionID)

END

Any help.


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>