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.