I need to setup a subscription to an SSRS report that I have, so it would send emails Daily between 5PM and 5AM only. Is this supported by SSRS 2005 or 2008?
My only option right now is to set up 12 different copies of the report and have 12 different subscriptions, for 5PM, 6PM, 7PM...4AM, 5AM etc. I don't like this approach for the maintenance complexity it adds.
Is there a better way to do this?
Thanks,
Nandun
Not through Report Manager; you've already seen that you have limited options there.
However, when you set up an SSRS subscription, behind the scenes it's just set up as a normal SQL Server job run through the SQL Server Agent - these jobs are set up under a GUID type name, i.e. something like 8DF42130-97D3-41F7-B3EF-72E48BFDFBFA.
This means that you can update the job schedule in Management Studio with a few more options:
You should be able to update a SSRS created subscription to suit your requirements.
Not sure why you can't just do this through Report Manager, but hopefully this will help.
Related
I have a SQL Server database that contains tables and other objects that I would like to script out on a regular basis. The idea is that I am going to create an autobuild that will create a container that is a scaled down version of this database (for testing).
I could easily just go script the database manually, but then I have to keep the resulting script up-to-date.
I am wondering if there a way to programmatically connect to a running SQL Server instance and (based off some input) generate scripts of specific tables, stored procedures, user defined types and data?
If you're coding with .NET other other languages that can call .NET objects, you can just use the scripting classes in SMO (SQL Management Objects).
There are worked examples in the SQL Server documentation here:
https://learn.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/tasks/scripting?view=sql-server-ver15
They are designed to do exactly what you're requesting.
Well, I would think a backup would be the easiest way to go.
Or, setup several jobs, wrap everything in a SProc, and schedule that to run on whatever frequency you desire.
To create and attach a schedule to a job
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties.
Select the Schedules page, and then click New.
In the Name box, type a name for the new schedule.
Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.
For Schedule Type, select one of the following:
Click Start automatically when SQL Server Agent starts to start the job when the SQL Server Agent service is started.
Click Start whenever the CPUs become idle to start the job when the CPUs reach an idle condition.
Click Recurring if you want a schedule to run repeatedly. To set the recurring schedule, complete the Frequency, Daily Frequency, and Duration groups on the dialog.
Click One time if you want the schedule to run only once. To set the One time schedule, complete the One-time occurrence group on the dialog.
is there a way that I can look into the report server execution log file before two months? I would like to dispose a reportserver database and want to see which report is last run. Sql Server Execution log file only stores for 2 months,but I want to see the log before that.I am using the Microsoft Sql Server 2005.
Thank you very much.
Short answer is no... As you've seen this is 60 days by default; after that SSRS will delete any old entries from its internal ExecutionLog table.
What you can do is change this default:
Server Properties (Logging Page)
This is not much use for your existing data but at least this might let you collect the information you need from now on.
I want to save any kind of log/tables with every query executed by my application.
I know I could do this by coding it (before I make any query, I insert a new row in a log table with the query and the user who is executing it.
I have read it can be done automatically but I'm not sure how can it work with WCF Services. I mean every query is going to be executed by the same SQL user and this wouldn't be very useful for audit operations (I need to know WHO made every query, and users will be validated against my own users tables).
Have you ever had a similar scenario? Thanks in advance!
As a starting point it may be worth looking into doing this via SQL Server Profiler. You can normally find this in the Tools Menu in Management Studio.
You can set up a trace to capture all SQL run on a server. More importantly you have a myriad of filter options which can be applied so that you only capture the data you are interested in (e.g. DatabaseName, UserName).
This information can be stored directly in a SQL Table, which should give you the abillity to join onto. Of course running anything like this will result in some overhead on the SQL box.
You can try the SQL Server Audit feature. It audits singe or groups of events both on server and database level. However, be advised that the database level auditing is available in SQL Server Enterprise and Developer editions only
I have a table of topics, topics might have an automatic publish date, I want to make SQL Server auto publishes them.
Previously I made it in code on each call to any method of the topics adapter, but I wanna make it automatically in SQL Server.
Can I?
It might be some kinda scheduled job or something like that.
I'm using SQL Server 2005 (Express and Professional).
What do you mean by 'publish'? It definitely sounds like you could use a SQL Server Agent job, to execute, say
UPDATE topics SET published = 1 WHERE publishdate < getdate()
if that is what all what you want to do, when you refer to 'auto publish'
EDIT
Since a SQL Server Agent job won't do. How about modifying your selects instead?
SELECT
(published OR publishdate < getdate()) as published
FROM
topics
I see that in the SQL Server Reporting Services 2005 Report Manager there is the capability to schedule reports for specific times (i.e. every weekday at a particular time).
What I would like though is more control -- i.e. every weekday, but only between certain dates of the year -- for example, getting sales figures every day starting 6 weeks before Christmas and ending 1 week after Christmas. There is a table that has the dates. How do I set that up in SQL Server Reporting Services 2005?
If you have Enterprise Edition you can create a Data Driven Subscription, whereby you generate a table of the report recipients and parameters and then point the report subscription to the table. You have complete control over how the table gets populated so you can make sure it only gets populated on the days you want the report to go out (the subscription would run every day but if the table is empty, it doesn't go out to anyone).
You can do what you ask in SSRS.
At the bottom of the Schedule details form, you can specify a start date and end date for the subscription.
You would however need to update those dates every year but you can setup a SSIS job to to that. You need to update the "StartDate" and "EndDate" columns in the "Schedule" table in your reporting services database (default name is "ReportServer").
I don't think there is a way to customize the Report Manager interface to show the custom schedule because there is a part of it that is managed by SSIS.
Yes you can remove the Subscription feature for some users. You can do that in SSMS, when connected to your report Server, in the Security | Roles section. The permission that manages the subscription feature is named : "Manage individual subscriptions". By removing it, your end users won't be able to create or update their subscriptions schedules.
Hope this helps!
Create a data driven subscription which calls a procedure, the procedure will determine the correct day (lets say, 1st business day of month). Have the schedule run every day, it will fire off the procedure which will only return on the specific day.