Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query to get list of susbscriptions with params and values


Query to get list of susbscriptions with params and values

Author
Message
mark 4643
mark 4643
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 167
I've be searching and trying for hours to get a query that gives me all current subscriptions from and SSRS serv with parameters and their values, so that they can be recreated on a new server (after pruning)

For example a simple report might be HoursByDepartment that takes three params:

@From =Today - 7 days (Default)
@To = Today (Default)
@Dept = 2 (part of subscription)

What I want to get is something along these lines (or something that will let me create a report)

Report ParamName ParamValue Default
HoursByDepartment From Today-7days True
HoursByDepartment To Today True
HoursByDepartment Dept 2 False

OR

Report Param1Name Param1Value Param1Def Param2Name Param2Value Param2Def
HoursByDepartment From Today-7days True To Today True

I'm pretty good with XSl, so if i could get something like, I could work with it

<subid>
<report>
<ParameterValues>
<ParameterValue>
<Name>MinAvailable</Name>
<Value>10000</Value>
</ParameterValue>
<ParameterValue>
<Name>OwnerIDs</Name>
<Value>0</Value>
</ParameterValue>
<ParameterValue>
<Name>ShowCosts</Name>
<Value>False</Value>
</ParameterValue>
<ParameterValue>
<Name>MinValue</Name>
<Value>0</Value>
</ParameterValue>
</ParameterValues>
</report>
</subid>


Regards

Mark
anthony.green
anthony.green
SSCertifiable
SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)

Group: General Forum Members
Points: 6091 Visits: 6069
This should get you to a pretty good starting point

SELECT
U.UserName AS SubscriptionOwner,
C.Path AS ReportPath,
CONVERT(XML,S.ExtensionSettings) AS SubscriptionSettings,
S.EventType AS SubscriptionType,
CONVERT(XML,S.Parameters) AS ReportParameters,
S.DeliveryExtension AS DeliveryMethod,
Sc.Name AS ScheduleName,
Rs.ScheduleID
FROM
Subscriptions S
INNER JOIN
Users U
ON
S.OwnerID = U.UserID
INNER JOIN
Catalog C
ON
S.Report_OID = C.ItemID
INNER JOIN
ReportSchedule RS
ON
S.SubscriptionID = RS.SubscriptionID
INNER JOIN
Schedule Sc
ON
RS.ScheduleID = Sc.ScheduleID
ORDER BY
1,2





Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


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