?
Solved

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

Posted on 2011-09-14
3
Medium Priority
?
1,777 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 1500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

765 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