Customize a Shared Schedule in SSRS - sql-server

Does anyone know of a way to create more complex shared schedules? If not, do you know of a way to simplify the schedule needs I have detailed below?
Creating a shared schedule in sql server 2008's SSRS does not seem to offer any additional complexities compared to report-specific schedules.
What I really need is the ability to create a schedule tied to my company's fiscal calendar. For example, it would be great to have a schedule that would send a report at the close of every fiscal month. Another example is of a report that emails throughout the day to provide operational updates. The report sends in intervals that do not align to anything I can express in the below configuration screen but rather to business needs. On Monday for example, the report will send at 8:15 AM, 12:15 PM, 2:15 PM, 4:15 PM, 6:15 PM and 9:15 PM. I cannot determine how to accomplish this pattern in one schedule, so I use multiple. Since the pattern is different for different days of the week, many schedules are needed. This is inefficient and cumbersome to manage when adding or removing recipients.
When first learning of shared schedules that could be configured on the server, I thought these problems would be solved. I am disappointed with the options below. The "Script" menu item remains gray through the process, so modifying the code this would generate does not appear to be an option either.
Thanks!

As Sir Crispalot notes in comments, you can't modify the SSRS schedule to this degree. A Shared Schedule doesn't give any options beyond the single schedule per report.
But you can change the schedule of the SQL agent that executes the subscription. Here you can associate multiple schedules with a subscription.
Another approach is to dynamically change the subscriptions and their schedules with some other code, such as a .NET .exe running on a schedule, or called by a SQL Agent. You could build a pretty nice scheduling interface for all your reports, storing the schedules however you like, then dynamically changing the subscriptions themselves: http://www.codeproject.com/KB/reporting-services/DynamicSSRSSubscriptions.aspx

Related

SQL Server Jobs and Schedules - New schedule per job or re-use?

Not a technical question as such, but I do wonder how other people deal with the Schedules in SQL Server in relation to SQL Agent.
Personally, I like to create a bunch of schedules and then reuse them for various jobs.
As an example, I like to name my schedules in the following manner:
Daily - Every 15 seconds midnight to midnight
Daily - Every 15 seconds between 03:20 and 23:55
Daily - Every 22 minutes from midnight to midnight
Daily - Every 3 hours - starting at 03:30 to 23:59:59
Daily - Every 30 seconds from 00:00:05
It's not that stringent, but it helps me to understand the schedules a little better.
And then, I like to associate my jobs with existing schedules (the rule in the team is : DO NOT modify schedules)
So I do end up with a number of schedules that are linked to numerous jobs.
Discussing this with a colleague and wondering what is the correct approach, most efficient approach to this, we tested things a little.
One behaviour I thought was surprising is as follows:
create a new job
during that process, create a new schedule and associate it to that job
run the job once (mine was "SELECT 1 as one") to be sure to be sure
then drop that SQLAgent job
I would have expected the schedule to remain, but as it turns out the newly created schedule is also dropped!
How do others feel about that? is this correct behaviour?
And do you prefer to create a new schedule for every new job you create? or re-use Schedules?
Hoping to hear interesting views,
Kindest,
B
I'm not sure this is entirely opinion based, but I also won't be surprised if it gets flagged as such.
In the shop where I had the most sway over job scheduling, we opted to create new schedules for each job. Sometimes just one, sometimes several. That way, if we were experiencing high load on any given server, we could tweak individual job schedules to spread out the load without impacting multiple jobs. Say, for instance, one of 6 jobs with the same start time started to process exponentially more data, that one job could easily be shifted by X minutes so it wasn't competing for resources, or causing competition.

Best Way to Pull in Live Data From 'Root' Database On Demand

Let me start by apologizing as I'm afraid this might be more of a "discussion" than an "answerable" question...but I'm running out of options.
I work for the Research Dept. for my city's public schools and am in charge of a reporting web site. We use a third-party vendor (Infinite Campus/IC) solution to track information on our students -- attendance, behavior, grades, etc. The IC database sits in a cloud and they replicate the data to a local database controlled by our IT Dept.
I have created a series of SSIS packages that pull in data each night from our local database, so the reporting data is through the prior school day. This has worked well, but recently users have requested that some of the data be viewed in real-time. My database sits on a different server than the local IC database.
My first solution was to create a linked server from my server to the local IC server, and this was slow but worked. Unfortunately, this put a strain on the local IC database, my IT Dept. freaked out and told me I could no longer do that.
My next & current solution was to create an SSIS package that would be called by a stored procedure. The SSIS package would query the local IC database and bring in the needed data to my database. This has been working well and is actually much quicker than using the linked server. It takes about 30 seconds to pull in the data, process it and spit it out on the screen as opposed to the 2-3 minutes the linked server took. It's been in place for about a month or so.
Yesterday, this live report turned into a parking lot -- the report says "loading" and just sits like that for hours. It eventually will bring back the data. I discovered the department head that I created this report for sent out an e-mail to all schools (approximately 160) encouraging them to check out the report. As far as I can tell, about 90 people tried to run the report at the same time, and I guess this is what caused the traffic jam.
So my question is...is there a better way to pull in this data from the local IC database? I'm kind of limited with what I can do, because I'm not in our IT Dept. I think if I presented a solution to them, they may work with me, but it would have to be minimal impact on their end. I'm good with SQL queries but I'm far from a db admin so I don't really know what options are available to me.
UPDATE
I talked to my IT Dept about doing transactional replication on the handful of tables that I needed, and as suspected it was quickly shot down. What I decided to do was set up an SSIS package that is called via Job Scheduler and runs every 5 minutes. The package only takes about 25-30 seconds to execute. On the report, I've put a big "Last Updated 3/29/2018 5:50 PM" at the top of the report along with a message explaining the report gets updated every 5 minutes. So far this morning, the report is running fantastically and the users I've checked in with seem to be satisfied. I still wish my IT team was more open to replicating, but I guess that is a worry for another day.
Thanks to everybody who offered solutions and ideas!!
One option which I've done in the past is an "ETL on the Fly" method.
You set up an SSIS package as a dataflow but it writes to a DataReader Destination. This then becomes the source for your SSRS Report. In effect this means that when the SSRS report is run - it automatically runs the SSIS package and fetches the data - it can pass parameters into the SSIS report as well.
There's a bit of extra config involved but this is straightforward.
This article goes through it -
https://www.mssqltips.com/sqlservertip/1997/enable-ssis-as-data-source-type-on-sql-server-reporting-services/

CRM 2011 find out which batch process last changed a record

I have inherited a poorly documnted CRM 2011 instance, lets call it 'haystack', that has literally 100s of batch processes and workflows running on it under the same user account (IT_Job). One of them, lets call it 'needle', has a problem.
I know 'needle' ran at noon. But the Advanced find only allows me to query the scheduled jobs down to the day they ran NOT the time they ran.
How do I find out which Batch Process or Workflow last updated an entity (incident). All I seem to be able to query the scheduled jobs by is IT_Job.
It seems to me that the only way to find the 'needle' job would be to systematically add a corresponding User for each job that acts on 'incident' to then search for job running as the user that last modified the record.
So how do I find 'needle' quickly?
EDIT
Ok it turns out the site I am working for won't allow me access to the database or allow me to deploy a console app. (One could argue that they're not interested in a solution to this problem) So is there any other way to query this data?
If you have access to the SQL server then you can query the table dbo.WorkflowLogBase. This will help you narrow down which workflows had run at that exact time.
You might also be able to add some extra information by looking at the audit history for the record that has been changed assuming that auditing is turned on.

Sending a summary of SQL Server Agent job failures

SQL Server Agent allows you to create Notifications at the moment a Job succeeds or fails, but I'd like to create a regular notification that sends a summary of the events for those who are one step removed from server maintenance.
Is there a way to setup summary notifications that spell out which jobs failed over the last 24 hours?
There are several system stored procedures that you might be able to use or you could query directly against the system tables. If you have SSRS available then put together a report using those queries and you can have it on-demand or scheduled to be emailed to the necessary people at whatever time is right for you.
Specifically, check out sp_help_jobhistory and sp_help_jobhistory_full in msdb.
I'd be surprised if you couldn't use Google to find a demo of setting this up.

Overriding SQL Server Reporting Service Hourly Subscription

Users want to set up SSRS reports to be emailed to them. After a little googling i found this link that shows the subscription interface of Report Manager. This has almost every feature they need except, the hourly report subscription does not give them enough control. By default, they are able to set up hourly reports, and provide the desired start time, but at first glance, I don't see how they specify an end time. What I need is a way to say "Send me a report every hour between 5 and 10."
So I'm looking for one of two answers:
Is there really an end time that I'm just missing?
If not, how can I override the hourly subscription page and get and end time.
Thanks
You can write your own subscription service using the SQL Reporting Service Web Services.
You can schedule a subscription to run the job hourly and then write your own service that will pause the jobs at the time they do not want the reports.
More info here:
http://msdn.microsoft.com/en-us/library/ms154066(SQL.90).aspx
Alternatively, you could also try editing the SQL Server job parameters. When reporting services creates a "subscription" a SQL Server job is created. There are starting and ending time parameters in that interface. I haven't verified that this provides the functionality you are looking for though.
Also, if that doesn't work and you don't want to code your own subscription service as mentioned, you could try creating 5 different jobs that run daily spaced an hour apart. I know it's kind of a kludge but maybe the extra job maintenance is preferable to the extra time for coding your own service.

Resources