Saturday, November 24, 2007

SQL:Linked report

A linked report is a shortcut to the base-report but with its own properties: parameters, execution, and history. For example, you create a base report with the following query:
Dataset 1:AdventureWorks
SELECT FirstName, LastName, e.Title
FROM HumanResources.Employee AS e
JOIN Person.Contact AS c ON e.ContactID = c.ContactID
WHERE e.Title IN (@Title)
Dataset2: TitleList
SELECT DISTINCT Title FROM HumanResources.Employee

Then, you can create a linked report with Title specified as Accountant,Marketing Assistant,Engineering Manager. When a user views the linked report, it only includes the 3 categories information.





==


cached report


When the first user opens the report, the report is placed a temporary copy of the report in a cache . When the subsequent users open the report, the report is returned from cache instead of being processing again. Cached reports will be expired at the set time.





report snapshot


When you want to create a report during off-peak period, you can schedule the report creation--snapshot. A snapshot report will not expire. It can be overwritten by the new one. A report history has many report snapshots.

In the site settings, you can define the number of snapshots are stored in a report history.