SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Subscriptions from Reporting Services get unintelligable job names in SQL Server Agent


Subscriptions from Reporting Services get unintelligable job names in SQL Server Agent

Author
Message
Andrew Tindall-297384
Andrew Tindall-297384
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 32

I am running Reporting Services in SQL Server 2000.

Is there any way of giving a subscription job a decent name, other than the automatic ED33F142-1F6B-4618-9B2F-7BD3FD63CC34 etc? Not exactly an easy name to remember, nor one which helps to identify which job does what. (You can rename Backup jobs with no problem).

Having submitted several jobs for scheduled running from within Reporting Services, SQL Server Agent shows a list of coded Names. I don't seem to be able to give the job a recognisable name within the subscription. If I rename the job in SQL Server Agent to something recognisable, I end up with 2 jobs running when the schedule time appears - the original Reporting Services generated one reappears, and the one I've previously renamed runs as well . This would obviously be no good if it was an update job, or a report got sent.

Any help would be appreciated...


stevefromOZ
stevefromOZ
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: Moderators
Points: 9732 Visits: 3757

It looks like the sqlagent job name is the guid actually used for the schedule stored within the database. Since the app (i.e. RS itself) will be relying on this, you can't chnge this.

But, you could use a view like below to produce a quick reference of what each guid (sql agent job) is doing. Note that because you're going directly against the app tables, these fields (types, names, relationships etc etc) could change in the future with no requirement on m$ft to inform anyone. ie if you do a sp upgrade and this stops working, chances are they changed something

SELECT Schedule.ScheduleID AS SQLAgent_Job_Name, Subscriptions.Description AS sub_desc, Subscriptions.DeliveryExtension AS sub_delExt,
[Catalog].Name AS ReportName, [Catalog].Path AS ReportPath
FROM ReportSchedule INNER JOIN
Schedule ON ReportSchedule.ScheduleID = Schedule.ScheduleID INNER JOIN
Subscriptions ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID INNER JOIN
[Catalog] ON ReportSchedule.ReportID = [Catalog].ItemID AND Subscriptions.Report_OID = [Catalog].ItemID

cheers,



Steve.
Andrew Tindall-297384
Andrew Tindall-297384
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 32

Thanks Steve. That view is perfect

Perhaps a future release of RS may allow us to use the Subscription Description as the SQLAgent Job Name instead of that guid. I can't be the only one to moan....

Cheers,

Andrew


stevefromOZ
stevefromOZ
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: Moderators
Points: 9732 Visits: 3757
you could always post it to sqlwish (i think its sqlwish@microsoft.com). Possible probs with this are that whoever is administering your sql may not have admin rights on your RS, so with guids they can't tell anything about the job and what it's for, with clear names they could. Plus i guess the guid allows you to have schedules with the same name without creating jobs with the same name.

Steve.
Paul.Mitchell.
Paul.Mitchell.
SSC Veteran
SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)

Group: General Forum Members
Points: 207 Visits: 106

I've used that view - it's really helpful, thanks.

However, it looks like the subscriptions.descriptions field only appears to give a description including the first email address on the 'to' list. Is there any way to get all of the email addresses returned including the 'cc' and 'bcc' addresses? where are they held as they don't seem to be in any of the tables?


stevefromOZ
stevefromOZ
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: Moderators
Points: 9732 Visits: 3757
If you look in the ExtensionSettings column of the Subscriptions table, there is an XML string that contains the relevant settings for the delivery extension. In this (email) case, there should be a To element with sub element of Value which contains the string of (semi-colon seperated) email addresses. With a little XML manipulation or perhaps even some regex (regular expressions) you could pull this out quite easily. You would probably want to look at the field DeliveryExtension and filter to ensure you're only looking at ReportServerEmail subscriptions.

HTH,

Steve.
Paul.Mitchell.
Paul.Mitchell.
SSC Veteran
SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)

Group: General Forum Members
Points: 207 Visits: 106

Thanks for the input. All I can see in this field is "<long text>". I don't know anything about xml or regex, so I don't know how to get started with this at all. Can anyone help with more detail?

Are there any applications available to help manage subscriptions? I'm using them more and more frequently.


stevefromOZ
stevefromOZ
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: Moderators
Points: 9732 Visits: 3757
Hi Paul,

The following should work

SELECT
Schedule.ScheduleID AS SQLAgent_Job_Name,
Subscriptions.Description AS sub_desc,
Subscriptions.DeliveryExtension AS sub_delExt,
[Catalog].Name AS ReportName,
[Catalog].Path AS ReportPath,
SUBSTRING(ExtensionSettings, LEN('TO') + CHARINDEX('TO', ExtensionSettings), CHARINDEX('', ExtensionSettings, CHARINDEX('TO', ExtensionSettings) + 1) - (LEN('TO') + CHARINDEX('TO', ExtensionSettings))) AS 'To Email recipient List'
FROM
ReportSchedule
INNER JOIN Schedule
ON ReportSchedule.ScheduleID = Schedule.ScheduleID
INNER JOIN Subscriptions
ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID
INNER JOIN [Catalog]
ON ReportSchedule.ReportID = [Catalog].ItemID
AND Subscriptions.Report_OID = [Catalog].ItemID
WHERE
Subscriptions.DeliveryExtension = 'Report Server Email'



Note that this SQL has some assumptions:
1. that the ExtensionSettings field (a text field) won't be longer than 8000 characters;
2. that you're only interested in the 'To' email address, it doesn't look for 'CC' or 'BCC' but with some minor manipulation of the search you could add this.

HTH,

Steve.
Paul.Mitchell.
Paul.Mitchell.
SSC Veteran
SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)SSC Veteran (207 reputation)

Group: General Forum Members
Points: 207 Visits: 106

Steve,

Many thanks for your help with this. I'm getting an error message I don't undertsand though: "Invalid length parameter passed to the substring function". Can that be solved?

Also, the 'CC' and 'BCC' fields would be very useful for me - many of my reports are CC'd to various recipients.

Any further help greatly appreciated; I'm sure this must also be useful for some other Reporting Services 'amateurs' like me

Cheers!

Paul.


stevefromOZ
stevefromOZ
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: Moderators
Points: 9732 Visits: 3757

Yep, the quick reply (ie *not* using WYSIWYG) escapes out all the xml/html tags

Here's another try, have included the CC and BCC.

USE ReportServer
GO


SELECT
Schedule.ScheduleID AS SQLAgent_Job_Name,
Subscriptions.Description AS sub_desc,
Subscriptions.DeliveryExtension AS sub_delExt,
[Catalog].Name AS ReportName,
[Catalog].Path AS ReportPath,
SUBSTRING(ExtensionSettings, LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', ExtensionSettings), CHARINDEX('</Value>', ExtensionSettings, CHARINDEX('<Name>TO</Name><Value>', ExtensionSettings) + 1) - (LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', ExtensionSettings))) AS 'To Email recipient List',
CASE CHARINDEX('<Name>CC</Name><Value>', ExtensionSettings) WHEN 0 THEN
''
ELSE
SUBSTRING(ExtensionSettings, LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', ExtensionSettings), CHARINDEX('</Value>', ExtensionSettings, CHARINDEX('<Name>CC</Name><Value>', ExtensionSettings) + 1) - (LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', ExtensionSettings)))
END AS 'CC Email recipient List',
CASE CHARINDEX('<Name>BCC</Name><Value>', ExtensionSettings) WHEN 0 THEN
''
ELSE
SUBSTRING(ExtensionSettings, LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', ExtensionSettings), CHARINDEX('</Value>', ExtensionSettings, CHARINDEX('<Name>BCC</Name><Value>', ExtensionSettings) + 1) - (LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', ExtensionSettings)))

END AS 'BCC Email recipient List'

FROM
ReportSchedule
INNER JOIN Schedule ON ReportSchedule.ScheduleID = Schedule.ScheduleID
INNER JOIN Subscriptions ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID
INNER JOIN [Catalog] ON ReportSchedule.ReportID = [Catalog].ItemID
AND Subscriptions.Report_OID = [Catalog].ItemID
WHERE
Subscriptions.DeliveryExtension = 'Report Server Email'




Steve.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search