I’m using this code to replicate Data Driven Subscriptions in MSSQL 2008.
As part of the queueing system it uses a
WAITFOR DELAY '00:00:30';
I’m planning on using this for over 200+ reports.
Will I have to schedule them to run at different times or will it all happily run queueing the reports and what is the performance hit?
Thanks
First, there is essentially no perormance hit (to other queries using) waitfor – its what it is amongst other things designed ie – releasing the processor to do other things. The question is what else is scheduled for then – Backups etc? I would be inclined to test the time taken for each report and write to a table (for your 201+ th report). It really depends on how intensive your reports are – and the fact that you are scheduling them for a quiet time suggests your resources are not limitless. I would be inclined to schedule reports for different time – even if only 5 seconds apart – specially if preceeding the report takes between 1 and 4 seconds. The sql batch will then be slightly more complex but run more smoothly. Also a query which tells you when reports have overlapped can help your scheduling. If you have parallelismn turned off and have 4 processors, you may run 4 reports at a time, but check your disk queue as well.