Lesson 1: Creating a Sample Subscriber Database
Applies To: SQL Server 2016 Preview
Before you can define a data-driven subscription, you must have a data source that provides subscription data. In this step, you will create a small database to store the subscription data used in this tutorial. Later, when the subscription is processed, the report server retrieves this data and uses it to customize report output, delivery options, and report presentation format.
This lesson assumes you are using Management Studio to create a SQL Server 2016 database.
To create a sample Subscriber database
Start Management Studio, and open a connection to a Database Engine.
Right-click on Databases, select New Database....
In the New Database dialog box, in Database Name, type Subscribers. Click OK.
Click the New Query button on the toolbar.
Copy the following Transact-SQL statements into the empty query:
Use Subscribers CREATE TABLE [dbo].[OrderInfo] ( [SubscriptionID] [int] NOT NULL PRIMARY KEY , [Order] [nvarchar] (20) NOT NULL, [FileType] [bit], [Format] [nvarchar] (20) NOT NULL , ) ON [PRIMARY] GO INSERT INTO [dbo].[OrderInfo] (SubscriptionID, [Order], FileType, Format) VALUES ('1', 'so43659', '1', 'IMAGE') INSERT INTO [dbo].[OrderInfo] (SubscriptionID, [Order], FileType, Format) VALUES ('2', 'so43664', '1', 'MHTML') INSERT INTO [dbo].[OrderInfo] (SubscriptionID, [Order], FileType, Format) VALUES ('3', 'so43668', '1', 'PDF') INSERT INTO [dbo].[OrderInfo] (SubscriptionID, [Order], FileType, Format) VALUES ('4', 'so71949', '1', 'Excel') GO
Click ! Execute on the toolbar.
Use a SELECT statement to verify that you have three rows of data. For example: select * from OrderInfo
You have successfully created the subscription data that will drive report distribution and vary the report output for each subscriber. Next, you will modify the data source properties of the report you will distribute to subscribers. Modifying the data source properties is done to prepare the report for data-driven subscription delivery. You will also modify the report design to include a parameter that the subscription will use with the subscriber data. Lesson 2: Modifying the Report Data Source Properties.