Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Holding up an SSRS Data Driven Subscription until the Report's Database Restore is Complete.

Status
Not open for further replies.

FarmboyEsq

Programmer
Apr 2, 2007
17
US
Hi,

Any nifty ideas on how I can hold up a report's data driven subscription until the data source (a SQL Server Database) is restored? My data driven subscription (DDS) is blowing up if it runs while the DB is still restoring.

The DDS reads a separate database, invoking a stored procedure that watching msdb.dbo.restorehistory waiting for this mornings restore to finish. It basically does a WAITFOR DELAY loop until its ready. I was hoping this would give me sufficient isolation from the DB being restored. (The DB being restored is the one that holds the data read by the report.)

But the DDS blows up whenever I test my approach with a restore running.

I would rather not move to SQL Server Agent job scheduling for these reports. But, am open to any and all ideas.

Thanks!
 
Well -- I think my problem was a phantom.

I am seeing separate between the subscription processing (which I want) and the report processing (which I'm trying to prevent, when the source DB is restoring.)

My subscription is now holding up the show, or returning zero rows such that the report doesn't run; it is not blowing up.

Thus, I'm able to control what happens when the report source DB restore has not yet completed.

Thanks.
 
Please note also, that I also had to change parameters used by the report, to not pull from the unavailable database. Fortunately, for the reports I have, this wasn't a huge deal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top