Solved

Data-Driven Subscriptions for SSRS Reports with SQL 2008 Standard Edition

Posted on 2011-09-14
3
1,704 Views
1 Endorsement
Last Modified: 2012-06-27
I have a need to create a scheduled report via email (2x weekly).  This report would be received by a dynamic list of individuals that would be published in a SQL table.  Ideally, I would do this in Report Manager and use data driven subscriptions.  However, I am on SQL Server 2008 Standard Edition which doesn't enable this functionality.  Does anyone have a recommendation, or a script that may offer similar functionality?
1
Comment
Question by:goodmanro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Expert Comment

by:TempDBA
ID: 36540903
You can create a .net application that make use of the rdl and send mail to the list of users through db_mail using the list you have in your table stored.
0
 
LVL 11

Accepted Solution

by:
SThaya earned 500 total points
ID: 36541030
Hi,

  please refer the below link

http://msdn.microsoft.com/en-us/library/ms169673.aspx

OR

Try to use the below XQuery


Steps:

1. Deploy the RDL in the reportserver
2.  create a subscription with the To and CC .
3.  create a sechdule for only one time (it create a Subcription id in the SQL job)
4. create SP with the below code .
5. sechdule a SQL job

Code :


create PROCEDURE [dbo].[gsp_EmailXQUERY]  
--@FileNAme Varchar(75)    
AS    
 

BEGIN

--To DECLARE the Local Variable

DECLARE @PARAMETERVALUES XML,@VDate VARCHAR(250),@FILENAME VARCHAR(MAX),
@RDLPath VARCHAR(MAX),@ItemID VARCHAR(250),@SbscrptnID VARCHAR(250),@newSubject VARCHAR(MAX)

--To Get the RDL path from catalog table from ReportServer

SET @RDLPath ='/ Reports/SAB/SutdataEmail'

 
select  @newSubject =  'Report:SiteData'


 
--Exportfile with Extn
SET @FILENAME=@newSubject

--To Get the ItemID from catalog table from ReportServer

SELECT @ItemID =  [ItemID] FROM ReportServer.dbo.[Catalog]
WHERE PATH = @RDLPath

--To Get the SubscriptionID with the help of ItemID from catalog table

SELECT  @SbscrptnID = Sch.[SubscriptionID]    
FROM   ReportServer.dbo.[ReportSchedule] Sch WITH (NOLOCK)
WHERE [ReportID] = @ItemID

--To SET Extension SETtings for the particular ID

SELECT @PARAMETERVALUES = ExtensionSETtings
FROM ReportServer.dbo.[Subscriptions]
WHERE  [DeliveryExtension] = 'Report Server Email'
and SubscriptionID =@SbscrptnID

--Use X-Query to replace the existng values
 
SET @PARAMETERVALUES.modify('replace value of (/ParameterValues/ParameterValue/Value/text())[5] with sql:variable("@FILENAME")')

--Update the New File Name in [Subscriptions] table

UPDATE ReportServer.dbo.[Subscriptions]
SET ExtensionSETtings =CAST(CONVERT(XML,@PARAMETERVALUES,1) as NVARCHAR(MAX))
WHERE  [DeliveryExtension] = 'Report Server Email'
and SubscriptionID =@SbscrptnID

--To Fire-up and Event based on the subscription ID
 
EXEC REPORTSERVER.DBO.ADDEVENT @EventType='TimedSubscription',@EVENTDATA=@SbscrptnID


END
0
 

Author Closing Comment

by:goodmanro
ID: 36816772
Using SQL Server Enterprise version is the easiest option.  SThaya offers a nice work-around for SQL Server Standard above.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question