Revision #88

You are currently reviewing an older revision of this page.
Go to current version
The SQL Server 2012 samples provide a variety of databases and files that you can use to learn about new and existing features. 

This article is the consolidated Readme for each sample in the SQL Server  2012 release. It provides prerequisite information, installation instructions, and links to the download location of each sample. This article will be updated periodically. Be sure to visit again.

 Important:
Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples.

Summary

The following table lists all Microsoft SQL Server  2012 samples, by technology.

Description Readme Link

Adventure Works OLTP database and data warehouse
   (relational database)

Adventure Works Sample Databases
Download AdventureWorksDWDenali Data File from Samples

The data warehouse will be modified in the final product release. For more information, see "Pending Changes for AdventureWorksDW in the SQL Server 2012 RTM Release" further down on this page

Analysis Services
   Multidimensional models

Analysis Services Tutorial on Multidimensional Modeling
Download SSAS Multidimensional Model Projects SQL Server 2012 RC0 from Samples

Analysis Services
   Tabular models
   Created in SQL Server Data Tools

Adventure Works DW Tabular SQL 2012 Download SSAS Tabular Model Projects SQL 2012 from Samples
Analysis Services
   Tabular models
   ADOMD sample
Querying a Tabular Model (developer sample)
Download Querying a Tabular Model from Samples

Reporting Services
   Power View reports

Model created in PowerPivot for Excel

Power View and PowerPivot Samples for SQL Server 2012 RC 0
Download from Power View and PowerPivot Samples.

Images for Power View and PowerPivot sample report and
workbook

Power View Sample Images
Download from Sample Images.

 

Scenario

Adventure Works Cycles publishes product and sales information that is accessed by employees throughout the company. The IT department manages the OLTP database and the OLAP data warehouse that stores the sales and manufacturing data. Data modelers prepare multidimensional and tabular models for self-service business intelligence for end users. Data analysts from different disciplines use client tools to investigate, analyze, and visualize data based on either the IT managed data sources or data models. To share their findings with colleagues and other teams, they publish files to a SharePoint site.

End users view and interact with data visualizations by using different reporting clients. Each reporting client varies in support for sources of data.

  1. For reports based on tabular models created in SQL Server Data Tools or in PowerPivot for Excel, end users launch ProPower View or PowerPivot from a SharePoint site.
  2. For reports based directly on OLAP cubes and RDBMS databases, end users run Reporting Services reports.

In this release, sample reports are included only for the first case.

Prerequisites

Server Prerequisites

Your system must meet the following requirements to use the samples.

Client Prerequisites

To create models, your system needs one or both of the following applications.

  • SQL Server Data Tools To create SQL Server 2012 RC 0 Analysis Services tabular models. For more information, see SQL Server Data Tools.
  • PowerPivot for Microsoft Excel 2010 To create models in PowerPivot. For more information, see PowerPivot for Excel.

For information about Power View requirements, see System requirements for Power View.
Back to top

Readme for Adventure Works Sample Databases

Download and install the SQL Server 2012 version of the Adventure Works OLTP database and data warehouse: AdventureWorksDW Data File from Samples.

Case-insensitive and case-sensitive AdventureWorks databases

The AdventureWorks2012 database has two versions: AdventureWorks2012_Data.mdf for case-insensitive and AdventureWorks2012_CS_Data.mdf for case-sensitive. You can also download a DDL script and .csv files to install the database from script. Download AdventureWorks 2012 OLTP Script.zip to create the case-insensitive database or AdventureWorks 2012 CS OLTP Script.zip for the case-sensitive database.

How to install AdventureWorks2012 OLTP database

The AdventureWorks2012 OLTP database can be installed using the CREATE DATABASE statement or by attaching the database.

To install AdventureWorks2012 OLTP database

  1. Download the AdventureWorks2012 Data File.

  2. From the License Agreement, click I Agree.

  3. From File Download, click Save and browse to a location on your local server.

  4. Case-insensitive Database

    CREATE DATABASE AdventureWorks2012 ON (FILENAME = '{drive}:\{file path}\AdventureWorks2012_Data.mdf') FOR ATTACH_REBUILD_LOG;

    Case-sensitive Database

    CREATE DATABASE AdventureWorks2012_CS ON (FILENAME = '{drive}:\{file path}\AdventureWorks2012_CS_Data.mdf') FOR ATTACH_REBUILD_LOG;

    As an alternative to step 4, you can attach the database using the SQL Server Management Studio user interface. For more detailed information, see Attach a Database (SQL Server Management Studio).

     Note:
    You must remove the log file from the list of files to attach. This will cause the operation to rebuild the log.

How to install AdventureWorks2012 OLTP database from script

The AdventureWorks database can be created by running the instawdb.sql DDL script contained in the AdventureWorks 2012 OLTP Script.zip or AdventureWorks 2012 CS OLTP Script.zip file. The instawdb.sql script depends on two path environment variables: SqlSamplesDatabasePath and SqlSamplesSourceDataPath. The SqlSamplesDatabasePath environment variable is set to the default Microsoft ® SQL Server 2012 path. The SqlSamplesSourceDataPath environment variable is set to the default script CSV data path. An invalid SqlSamplesSourceDataPath path generates an error that the bulk load steps failed because the .csv files could not be found. The DDL script must be ran in SQLCMD mode inside SQL Server Management Studio.

To install AdventureWorks2012 OLTP database from script

  1. Download AdventureWorks 2012 OLTP Script.zip or AdventureWorks 2012 CS OLTP Script.zip.
  2. Copy the DDL script files to {SQL Server Path}\Tools\Samples\AdventureWorks 2012 OLTP Script.

    Note The default SQL Server 2012 path is C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\.
  3. Open {SQL Server Path}\Tools\Samples\AdventureWorks 2012 OLTP\instawdb.sql in SQL Server Management Studio.
  4. On the Query menu, click SQLCMD Mode.
  5. On the Standard toolbar, click the Execute button to run the script.


Install AdventureWorksDWDenali data warehouse

  1. Click the AdventureWorksDWDenali Data File link on Adventure Works for SQL Server 2012 RC0.

  2. From the License Agreement, click I Agree.

  3. From File Download, click Save and browse to a location on your local server.

  4. From SQL Server Management Studio, execute the following code:

    {{ CREATE DATABASE AdventureWorksDWDenali ON (FILENAME = '<drive>:\<file path>\AdventureWorksDWDenali_Data.mdf') FOR ATTACH_REBUILD_LOG ;}}

    As an alternative to step 4, you can attach the database using the SQL Server Management Studio user interface. For more detailed information, see Attach a Database (SQL Server Management Studio).

     Note:
    You must remove the log file from the list of files to attach. This will cause the operation to rebuild the log.

     

Pending Changes for AdventureWorksDW in the SQL Server 2012 RTM Release

This notice informs you of upcoming changes to the Adventure Works DW database in the SQL Server 2012 final product release.  If you use the Adventure Works DW database for testing or instructional purposes, review the following change list so that you update any materials that are based on this data source. 

  • YEAR data shifted by 4.  Before the year shift,  dates ranged from  January 1, 2001 through December 31, 2006, with 2004 being a leap year. In the next version of the Adventure Works DW database, the date range is January 1, 2005 through December 31, 2010, with the leap year occurring in 2008.
  • WEEKNUMBER is now consistent with the output produced by the T-SQL DATEPART command, following ISO standard 8601. Although this was a relatively small change in terms of number of rows affected, you should test any scripts, code, or examples that include the WEEKNUMBER column.
  • Additional IMAGES are now available in the data warehouse. Previously, images were primarily in the OLTP database. This release adds more images to the data warehouse.

Databases affected:

  • AdventureWorksDWDenali database –This is the relational data warehouse used in various tutorials and as the underlying data source for Analysis Services multidimensional and tabular model projects.
  • Adventure Works DW Tabular Denali database – This tabular model is built from the Adventure Works Tabular Denali project, using the Adventure Works DW database as its underlying data source.
  • Adventure Works DW Multidimensional Denali database – This multidimensional model is built from the Adventure Works DW Multidimensional Denali project, available in Enterprise and Standard versions to support different levels of functionality. Both projects use the Adventure Works DW database as the underlying data source.
  • Analysis Services Tutorial Projects – This is a collection of multidimensional model projects that supplement the Analysis Services tutorial. All of the tutorial projects use the Adventure Works DW database as the underlying data source.
  • Data Mining Model Projects – This is a collection of data mining model projects that supplement the Data Mining tutorials. All of the data mining projects use the Adventure Works DW database as the underlying data source.

Back to top

       

Readme for Analysis Services Tutorial on Multidimensional Modeling

This sample includes 11 sample projects that accompany the Analysis Services multidimensional modeling tutorial. Download SSAS Multidimensional Model Projects SQL Server 2012 RC0 from Samples. The projects show a completed, working example of the solution you would have created if you were following the lessons in the tutorial. You can use a completed project to compare against your work, or to jump ahead in the tutorial. For example, if you want to go directly to Lesson 5, you can start with Lesson 4 – completed.

This sample also includes a startup project for Lesson 4. Lesson 4 includes extra dimensions, attributes, and relationships that you would not have created in Lesson 3. The extra objects are added to save you from having to repeat steps that you already learned. Lesson 4 assumes you are starting with the extra objects provided in a sample project that is part of this download.

Note:  These tutorials are a work in progress. Screenshots are out of date. Instructions for browsing data are also incorrect. We recommend that you use the Analyze in Excel feature to browse data in the tutorials.

Step 1: Install the AdventureWorksDWDenali Database and Grant Permissions    

  1. The sample projects use transactional data that you import from a relational database management system or some other external data source. For the purposes of these sample projects, you will install the AdventureWorksDenaliDW relational database. Download the sample database from Codeplex

  2. Unzip the sample databases.

  3. Copy the AdventureWorksDWDenali_Data.mdf file to the data directory of the local SQL Server Database Engine instance. By default, it is located at C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data.

  4. Start SQL Server Management Studio and connect to the Database Engine instance.

  5. Right-click Databases, click Attach.

  6. Click Add.

  7. Select the AdventureWorksDWDenali_Data.mdf database file and click OK.

  8. In database details, remove the Log file entry. The sample download does not include a log file. A new log file will be created automatically when you attach the database. Select the log file and click Remove, and then click OK to attach just the primary database file.

  9. Determine the service account under which Analysis Services is running. You can use SQL Server Configuration Manager or the Services console application to view account information. If you installed Analysis Services using the default account, the service is running as NT Service\MSSQLServerOLAPService.

  10. In Management Studio, connect to the database engine instance.

  11. Expand the Security folder, right-click Logins and select New Login.

  12. On the General page, in Login name, type NT Service\MSSQLServerOLAPService (or whatever account the service is running as).

  13. Click User Mapping.

  14. Select the checkbox next to the AdventureWorksDWDenali database. Role membership should automatically include db_datareader and public. Click OK to accept the defaults.

Step 2: Install and Open Analysis Services Tutorial Projects

  1. Download the sample project files from Codeplex.

  2. Unzip the sample projects. After you extract the files, you should have the following projects installed in the SSAS Multidimensional Tutorial Projects folder on your computer:

    • Lesson 1 Complete
    • Lesson 2 Complete
    • Lesson 3 Complete
    • Lesson 4 Complete
    • Lesson 4 Start
    • Lesson 5 Complete
    • Lesson 6 Complete
    • Lesson 7 Complete
    • Lesson 8 Complete
    • Lesson 9 Complete
    • Lesson 10 Complete
  3. Start SQL Server Data Tools.

  4. Open the solution (.sln) file that corresponds to the lesson you are using.

  5. Deploy the solution to verify that database permissions and server location information is set up correctly.

    If Analysis Services and the Database Engine are installed as the default instance (MSSQLServer) and all software is running on the same computer, you can click Deploy on the Project menu to build and deploy the sample project to the local Analysis Services instance. During deployment, data will be processed (or imported) from the AdventureWorksDWDenali database on the local Database Engine instance.

    If you encounter errors, review the previous steps on setting up database permissions. You might also need to change server names, for example, an instance name if you installed either Analysis Services or the Database Engine as a named instance. Additionally, if the servers are on a different server, you might need to configure Windows Firewall to allow access to the servers.

  6. In SQL Server Management Studio, connect to Analysis Services. Verify that a database named Analysis Services Tutorial is running on the server. 

Requirements

Using the sample projects requires that you install the following features using SQL Server 2012 RC0 installation media:

  • Database Engine
  • Analysis Services installed in Multidimensional server mode (default)
  • SQL Server Data Tools 
  • SQL Server Management Studio

Optionally, consider installing Excel. Installing Excel enables the Analyze in Excel feature that starts Excel using a PivotTable field list that is connected to the cube you are building. Using Excel to browse data is recommended because you can quickly build a pivot report that lets you interact with the data. Alternatively, you can use the built-in MDX query designer. The query designer returns the same data, except the data is presented as a flat rowset. 

Demonstrates

The projects in this sample demonstrate how to build an Analysis Services multidimensional model in SQL Server Data Tools.

Back to top

Readme for Adventure Works DW Multidimensional Denali

This sample contains projects to build the multidimensional model of Adventure Works DW SQL Server 2012 RC0, for the enterprise and standard edition of SQL Server.

Install the samples

  1. Unzip the download file to your downloads folder.

  2. Unblock the zip file to use the solution file inside (this applies to Windows XP, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2):

    1. Right click on the file and select properties

    2. Locate the UNBLOCK button, in the lower right side of the properties window, and click it.

    3. If you don't unblock the zip file you will have to unblock all individual files inside the zip file.

  3. (Optional) Locate the 'Adventure Works DW Multidimensional SQL Server Denali' folder and move, or copy, that folder to your Visual Studio 2010 projects folder

  4. Install the relational data source AdventureWorksDWDenali, if not available to you. See the readme of the database to do so.

  5. The solution files are located under Adventure Works DW Multidimensional Denali folder.

Test and validate the samples

  1. Verify your administrator access to a multidimensional instance of Analysis Services:

    1. Open SQL Server Management Studio and connect to an Analysis Services instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA about server name and instance.

    2. Expand the Databases folder and make mental note of the existing databases.

    3. Right click the Databases folder and select New Database.

    4. In the Database name text box add any name you want; make sure it doesn't exist and is short (you are going to create and delete the database immediately).

      Click OK to create an empty database.

    5. If you succeeded creating the database, delete the database by right clicking on the database name and following the delete steps.

      If you couldn't successfully create a database, because of permission rights, then you need to have access to an instance where you have administrator credentials before continuing with this installation.

  2. Depending on the edition of SQL Server that you have installed, open the Standard or Enterprise folder. If you are using the Developer evaluation edition, it has the same behavior as Enterprise edition.

  3. Double click the solution file: Adventure Works DW Multidimensional Denali.sln.

    If it doesn't open BIDS then the feature wasn't correctly installed; you need to go over the setup process and add the BIDS feature to your installation.

  4. Once the solution is open, in the Solution Explorer pane locate the Data Source folder. Right click the 'Adventure Works.ds' data source and from the context menu select 'Open' and in the connection string area click 'Edit'.

  5. In the connection manager window:

    1. Verify the server name points to the server and instance where AdventureWorksDWDenali database is located.

    2. Verify you have the correct log on to the server credentials.

    3. Verify connect to a database points to AdventureWorksDWDenali

    4. Click on Test Connection and the connection should succeed

  6. Right click the database object, it is the topmost object in the Solution Explorer tree, and select Properties.

  7. In the navigation tree, on the left pane, select Deployment and verify the Server property names the Analysis Services instance where you have administrator privileges (step 1); adjust if needed and click OK, otherwise you can click Cancel.

  8. Right click the database object, again, and select Show Deployment Progress.

  9. Right click the database object, again, and select Deploy.

    Watch the deployment progress until it comes to a successful end. 

Requirements

Requirements to install and deploy Adventure Works DW Multidimensional Denali sample database and project:

  • Windows 2008 R2
  • SQL Server Analysis Services SQL Server 2012 RC0, an instance deployed in multidimensional mode.
  • SQL Server Data Tools, a feature to install when installing SQL Server, used to create Analysis Services projects.
  • Read access to an instance of AdventureWorksDWDenali database.  

Demonstrates

Analysis Services Multidimensional capabilities.

Back to top

Readme for Adventure Works DW Tabular SQL 2012 RC0.

This sample contains project to build the tabular model of Adventure Works DW Tabular SQL 2012 RC0. Download SSAS Tabular Model Projects SQL 2012 RC0 from Samples.

 

 ! Alert !
This sample is not meant to be used in DirectQuery mode. See Formula Compatibility in Direct Query Mode to obtain a deeper understanding of the differences about running a model in In-Memory mode versus DirectQuery mode.


Install the samples

 

  1. Unzip the download file to your downloads folder.

  2. Unblock the zip file to use the solution file inside (this applies to Windows XP, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2):

    1. Right click on the file and select properties

    2. Locate the UNBLOCK button, in the lower right side of the properties window, and click it.

    3. If you don't unblock the zip file you will have to unblock all individual files inside the zip file.

  3. (Optional) Locate the 'Adventure Works DW Tabular SQL 2012 RC0' folder and move, or copy, that folder to your Visual Studio 2010 projects folder

  4. Install the relational data source AdventureWorksDWDenali, if not available to you. See the readme of the database to do so.

  5. The solution files are located under Adventure Works DW Tabular SQL 2012 RC0 folder. 

Test and validate the samples    

  1. Verify your read access to the relational data source AdventureWorksDWDenali

    1. Open SQL Server Management Studio and connect to a Database Engine instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA for server name and instance.

    2. Expand the Databases folder.

    3. Locate the AdventureWorksDWDenali database.

      If you don't see the database, this might be because the database is not installed in the server or you don't have privileges to access the database; contact your DBA to help you to gain access to the database.

    4. Expand the AdventureWorksDWDenali database object, expand the tables folder

    5. Select any table, right click on it and click on Select Top 1000 rows.

      If the select statement successfully returns rows you should have all privileges needed to reload data in your workbook.

      If no rows are returned or an error occurs contact your DBA to obtain help.

  2. Verify you have administrator privileges to access a tabular instance of Analysis Services where your workspace database and the sample model would be deployed:

    1. Open SQL Server Management Studio and connect to an Analysis Services instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA about server name and instance.

    2. Right click the server instance, on the left pane, and select Properties.

    3. If no error message appears when you clicked on properties and you got the properties tab in the right pane, then you have administrator privileges in the server.

      If you got an error, it probably says something like the following text: The connected user is not an Analysis Services administrator.. Ask your DBA to give you administrator permissions.

  3. Open the folder that contains the solution files.

  4. Double click the solution file: Adventure Works DW Tabular 2012 RC0.sln.

    If it doesn't open BIDS then the feature wasn't correctly installed; you need to go over the setup process and add the BIDS feature to your installation.

  5. Once the solution is open, in the Solution Explorer, right click over the Adventure Works DW Tabular SQL 2012 RC0.bim file and select Properties. Verify the Workspace Server name matches the tabular instance from step 2; adjust as needed.

  6. In the Solution Explorer pane, double click over the Adventure Works DW Tabular SQL 2012 RC0.bim file.

    A warning dialog, titled Business Intelligence Semantic Model, appears with the following message Opening this file in the BIM Designer causes a script to be executed on an Analysis Services server..., click Yes to accept; accepting sends the model to your workspace server, generates the model there and presents the model to you in BIDS. Wait a moment until the model appears in the window.

  7. From the menu bar, click on Model and select Existing connections.

    Click on Edit and verify the data source information points the AdventureWorksDWDenali database verified in step 1. Adjust as needed; click on Test Connection to verify all parameters are correct. Click on the Impersonation... button and verify Service Account is selected.  This means the Analysis Services service account will be impersonated when reading data from the AdventureWorksDWDenali database (during data refresh in step 8 below).  Make sure the service account has at least db_datareader permissions to the AdventureWorksDWDenali relational database otherwise you will get an error when you try to refresh the data.   Click on Save and Close in the next window to return to the model.

  8. Again, from the menu bar, click on Model, hover over Refresh and select Refresh All from the context menu. Wait a moment until the model, with data, appears in the window.

  9. Some tables may appear with a warning sign on the name label; this is because some calculated columns need to be re-calculated to get their correct values.

    1. From the menu bar, click on Model, hover over Calculation Options and select Manual Calculation.

    2. Select one table with the warning sign, by clicking on the label. From the menu bar, click on Model and select Calculate Now.

    3. Repeat the recalculate step for each table with a warning sign. Also, remember to review all tabs from the scroll menu, located to the right of the right most visible table tab.

  10. From the menu bar, click on File and select Save All.

  11. In the Solution Explorer pane, right click on Adventure Works DW Tabular SQL 2012 RC0 project and select Properties. Select Deployment from the left pane. Verify the Server name matches the tabular instance from step 2; adjust as needed.

    Click OK to close the properties window.

  12. In the Solution Explorer pane, right click on Adventure Works DW Tabular SQL 2012 RC0 project and select Deploy. Wait a moment until the model is deployed. 

  13. To test the deployed instance of the sample model:

    1. Open SQL Server Management Studio and connect to the Analysis Services instance from step 2.

    2. Expand the Databases folder and locate Adventure Works DW Tabular SQL 2012 RC0. There might be another database with the same name and your username and a GUID, which is your workspace database.  You can identify workspace server and workspace database used by a model by checking the Workspace Database and Workspace Server properties of the .bim file in SQL Server Data Tools.

    3. Right click on Adventure Works DW Tabular SQL 2012 RC0 database, hover over New Query and select MDX.

    4. Verify that Adventure Works DW Tabular SQL 2012 RC0 is the selected database in the Available Databases drop down list box (use <CTRL><ALT><J> shortcut to locate the list).

    5. In the query window copy/paste the following MDX expression:

      Select Non Empty [Date].[Calendar Year].members on rows,
             Non Empty [Product Category].[Product Category Name].members on columns
      from [Model]
      where [Measures].[Total Sales]
      
    6. Click the Execute ! button.

    7. The following results should appear after a moment:

      All Accessories Bikes Clothing Components

      All

      $109,809,274.20

      $1,272,057.89

      $94,620,526.21

      $2,117,613.45

      $11,799,076.66

      2001

      $11,331,808.96

      $20,235.36

      $10,661,722.28

      $34,376.34

      $615,474.98

      2002

      $30,674,773.18

      $92,735.35

      $26,486,358.20

      $485,587.15

      $3,610,092.47

      2003

      $41,993,729.72

      $590,242.59

      $34,910,877.69

      $1,010,112.16

      $5,482,497.29

      2004

      $25,808,962.34

      $568,844.58

      $22,561,568.03

      $587,537.80

      $2,091,011.92

 Requirements

Requirements to install and deploy Adventure Works DW Tabular Denali sample database and project:

  • Windows 2008 R2
  • SQL Server Analysis Services SQL 2012 RC0, an instance deployed in tabular mode.
  • SQL Server SQL 2012 RC0 Data Tools, a feature to install when installing SQL Server.
  • Read access to an instance of AdventureWorksDWDenali database.  

Demonstrates

Analysis Services Tabular capabilities.

Back to top

 

Readme for Power View and PowerPivot HelloWorldPicnic Samples for SQL Server 2012 RC0

These samples use HelloWorld_Picnic, a tiny, simple data model, to demonstrate new features of Power View (formerly Project Crescent) and PowerPivot for Excel for SQL Server 2012 Release Candidate 0 (RC0). The fictional data tracks use of food and drink at picnics.
 
The Power View sample report features multiple pages, export to PowerPoint, filtering, sorting, chart interactivity, charts with a ‘play’ axis, using images to enhance design, and other new functionality. Open the sample report or make it yourself following the Power View tutorial.
 
The PowerPivot sample workbook shows new reporting properties and some best practices for enhancing Power View reports. Open the sample workbook or make it yourself following the PowerPivot tutorial.

Download Power View and PowerPivot for Excel HelloWorldPicnic Samples zip file package.

You also need to download a set of image files from the Microsoft Download Center. Download Sample Images.

You can do a few different things with these sample files:

  • Explore and interact with a completed report created in Power View and model created in PowerPivot for Excel.
  • Create a Power View report based on a model created in PowerPivot for Excel.
  • Create a model in PowerPivot for Excel and then optimize it for Power View (and then create a Power View report based on your model).

Prerequisites
See the Prerequisites section.

Contents of the Download File
The PowerViewPowerPivotHelloWorldPicnicSamples download zip file package contains these files:

For the Power View tutorial

  • HelloWorldPicnicPowerViewTutorialRC0.xlsx PowerPivot sample model from which you can build simple Power View reports, including HelloWorldPicnicReportRC0.rdlx
  • HelloWorldPicnicReportRC0.rdlx Completed sample Power View (RDLX) file that you can create yourself from HelloWorldPicnicPowerViewTutorialRC0.xlsx, by following the Tutorial: Create a Sample Report in Power View.

For the PowerPivot tutorial
  • HelloWorldPicnicModelPowerPivotTutorialRC0.xlsx Plain Excel (XLSX) file with nothing but tables, which you can modify to create the model HelloWorldPicnicPowerViewTutorialRC0.xlsx by following the Tutorial: Optimize a Sample PowerPivot Model for Power View Reports.
  • HelloWorldPicnicPowerPivotDAXRC0.txt Notepad (TXT) file with DAX expressions that you can copy and paste into the PowerPivot file, according to the PowerPivot tutorial.

You will also need this zip file for both Power View and PowerPivot:
Download the HelloWorldPicnic XLSX and RDLX files
  1. Download the PowerViewPowerPivotHelloWorldPicnicSamples zip file.
  2. Unzip the files to a local folder. There are four files.


Publish the HelloWorldPicnic XLSX files

  • Upload the PowerPivot (XLSX) files to the PowerPivot Gallery on your SharePoint site.

If your SharePoint site does not have a PowerPivot Gallery, you can upload the files to the Shared Documents library on your SharePoint site. In that case, you will need to create a shared data source so you can create Power View reports based on the XLSX files.

Publish HelloWorldPicnicImages

  1. Download HelloWorldPicnicImages from Sample Images . For more information about the images, see the ReadMe on the download site.
  2. Unzip the files to a local folder. There are 56 .png files.
  3. In the SharePoint site document library Shared Documents, create a folder named HelloWorldPicnicSample, and then a subfolder named Images.
  4. Upload all the .png image files to the Images folder.

Setting up the Power View Samples

Start Power View

  • From the PowerPivot Gallery, Gallery View, for HelloWorldPicnicPowerViewTutorialRC0.xlsx, click the Create Power View Report icon.

Follow the tutorial.

 Alternatively, you can upload the sample report, as described in the next procedures.

Upload the sample Power View report and bind it to the PowerPivot model

Upload the report to the PowerPivot Gallery
If you uploaded the XLSX file to the PowerPivot Gallery, upload the report there, too.

  1. Upload the PowerPivot workbook HelloWorldPicnicReportRC0.rdlx to the PowerPivot Gallery.
  2. In the PowerPivot Gallery, click the Library tab and switch Current View from Gallery to All Documents.
  3. From the drop-down menu for the report, click Manage Data Sources. The data source page displays EntityDataSource.
  4. Click EntityDataSource to open the data source management page.
  5. In Data Source Link, paste in the following text:

http://localhost/PowerPivot Gallery/HelloWorldPicnicPowerViewTutorialRC0.xlsx

  1. If you need to, substitute the URL for the sample model on your SharePoint site.
  2. Click OK, and then click Close.

OR: Upload the report to Shared Documents
If you uploaded the XLSX file to Shared Documents, upload the report there, too.

  1. Upload the PowerPivot workbook HelloWorldPicnicReportRC0.rdlx to Shared Documents on your SharePoint site.
  2. Create an RSDS file called HelloWorldPicnicRSDSRC0.rsds.

For help creating the RSDS file, see “Before you start the tutorial” in Tutorial: Create a Sample Report in Power View.

  1. From the drop-down menu for the report, click Manage Data Sources. The data source page displays EntityDataSource.
  2. Click EntityDataSource to open the data source management page.
  3. In Data Source Link, browse to HelloWorldPicnicRSDSRC0.rsds.
  4. Click OK, and then click Close.

Setting up the PowerPivot Samples

Start PowerPivot

You can open either XLSX workbook in Excel and then open the PowerPivot window.

  • HelloWorldPicnicPowerViewTutorialRC0.xlsx is a completed PowerPivot sample model from which you can build simple Power View reports, including HelloWorldPicnicReportRC0.rdlx
  • HelloWorldPicnicModelPowerPivotTutorialRC0.xlsx is a plain Excel (XLSX) file with nothing but tables, which you can modify to create the model HelloWorldPicnicPowerViewTutorialRC0.xlsx by following the Tutorial: Optimize a Sample PowerPivot Model for Power View Reports.

Start PowerPivot from the PowerPivot Gallery

  1. From the PowerPivot Gallery, click the image of the file HelloWorldPicnicModelPowerPivotTutorialRC0.xlsx.

This opens the workbook in SharePoint.

  1. Click Open in Excel.
  2. Click the PowerPivot tab, and then click PowerPivot Window.
  3. Follow the tutorial steps in Tutorial: Optimize a Sample PowerPivot Model for Power View Reports.

OR: Start PowerPivot from Shared Documents

  1. From Shared Documents, for HelloWorldPicnicModelPowerPivotTutorialRC0.xlsx, click the dropdown arrow and click Edit in Microsoft Excel.
  2. Click the PowerPivot tab, and then click PowerPivot Window.
  3. Follow the tutorial steps in Tutorial: Optimize a Sample PowerPivot Model for Power View Reports.


Back to top    
About HelloWorldPicnic Sample Images for Power View and PowerPivot
HelloWorldPicnicImages includes 56 .png image files that are used in the HelloWorldPicnic sample model for PowerPivot for Excel and sample report for Power View. The images represent the 4 categories -- fruits, vegetables, breads, and beverages -- and 24 items in these categories. For each of the 24 items, there are 2 files: a picture and a drawing of that item. For the 4 categories, there are 2 files: a picture and a drawing of the category.

Download the images and the ReadMe from Sample Images . For information about copyright and usage terms for the images, see the ReadMe on the download site.
For information about publishing the images to your SharePoint site, see Publish HelloWorldPicnicImages in this document.

Back to top

Readme for AMO2Tabular SQL 2012 RC0 (developer sample)

The AMO2Tabular SQL 2012 RC0 sample is a C# sample, using AMO, to create a tabular model. Through the sample the developer gets acquainted with the relationship between AMO objects and the logical set of objects presented in tabular models. Download SSAS AMO2Tabular SQL 2012 rc0 from Samples.

Install the sample

  1. Unzip the download file to your downloads folder.

  2. Unblock the zip file to use the solution file inside (this applies to Windows XP, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2):

    1. Right click on the file and select properties

    2. Locate the UNBLOCK button, in the lower right side of the properties window, and click it.

    3. If you don't unblock the zip file you will have to unblock all individual files inside the zip file.

    (Optional) Locate the 'AMO2Tabular SQL 2012 RC0' folder and move, o copy, that folder to your Visual Studio 2010 projects folder

  3. (optional) Install the relational data source AdventureWorksDWDenali, if no other relational data source is available to you. See the readme of the database to do so.

  4. The solution files are located under AMO2Tabular Denali SQL 2012 RC0 folder.

Test and validate the sample code 

  1. Verify your read access to the relational data source AdventureWorksDWDenali. If you are planning to use a different relational data source, use that name whenever you are asked to use AdventureWorksDWDenali.

    1. Open SQL Server Management Studio and connect to a Database Engine instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA for server name and instance.

    2. Expand the Databases folder.

    3. Locate the AdventureWorksDWDenali database.

      If you don't see the database, this might be because the database is not installed in the server or you don't have privileges to access the database; contact your DBA to help you to gain access to the database.

    4. Expand the AdventureWorksDWDenali database object, expand the tables folder

    5. Select any table, right click on it and click on Select Top 1000 rows.

      If the select statement successfully returns rows you should have all privileges needed to reload data in your workbook.

      If no rows are returned or an error occurs contact your DBA to obtain help.

  2. Verify you have administrator privileges to access a tabular instance of Analysis Services where sample model would be created:

    1. Open SQL Server Management Studio and connect to an Analysis Services instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA about server name and instance.

    2. Right click the server instance, on the left pane, and select Properties.

    3. If no error message appears when you clicked on properties and you got the properties tab in the right pane, then you have administrator privileges in the server.

      If you got an error, it probably says something like the following text: The connected user is not an Analysis Services administrator.. Ask your DBA to give you administrator permissions.

  3. Open the folder that contains the solution files.

  4. Double click the solution file: AMO2Tabular.sln.

    If it doesn't open Visual Studio 2010 then the feature wasn't correctly installed; you need to go over the setup process and install Visual Studio 2010 again.

  5. Once the solution is open, in the Solution Explorer, right click over the References folder and select Microsoft.AnalysisServices. If a warning sign appears with the label, you need to recreate the reference; otherwise you should be good to continue.

    If you need to recreate the reference to the latest build of Microsoft.AnalysisServices.dll of RC0 or later version; the file should be located at C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.AnalysisServices.dll.

     Caution:
    This sample requires the SQL Server 2012 RC0  or later version of Microsoft.AnalysisServices.dll to compile and work.
  6. Click on Build, from the menu bar, and select Rebuild Solution. Wait until the solution is compiled.

  7. Click on Debug, from the menu bar, and select Start Debugging. Wait until the form appears on the screen.

  8. Your sample application is functional

Requirements

Requirements to install and deploy Adventure Works DW Tabular Denali sample database and project:

  • Windows 7 or Windows 2008 R2
  • Visual Studio 2010 Professional or Visual Studio Express 2010, with C# language installed.
  • SQL Server Analysis Services 2012 RC0, an instance deployed in tabular mode.
  • SQL Server Data Tools 2012 RC0, a feature to install when installing SQL Server.
  • Read access to an instance of AdventureWorksDWDenali database.

 Back to top

Readme for Querying a Tabular Model (developer sample)

The Querying a Tabular Model sample is a C# sample, using ADOMD, to query a tabular model using DAX expressions and MDX expressions. The sample shows that either way (DAX or MDX) can be used to do the query in the same fashion; the functionality is the same regardless of your syntax choice. Download Querying a Tabular Model from Samples.

Install the sample:

  1. Unzip the download file to your downloads folder.
  2. Unblock the zip file to use the solution file inside (this applies to Windows XP, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2):
    1. Right click on the file and select properties
    2. Locate the UNBLOCK button, in the lower right side of the properties window, and click it.
    3. If you don't unblock the zip file you will have to unblock all individual files inside the zip file.
  3. (Optional) Locate the 'Querying a Tabular Model' folder and move, o copy, that folder to your Visual Studio 2010 projects folder
  4. Install the tabular data source Adventure Works DW Tabular SQL 2012 RC0. See the readme of the database to do so. If you plan to use a different tabular data source then you’ll have to update the source code to use your tabular source.
  5. The solution files are located under Adventure Works DW Tabular SQL 2012 RC0 folder.

Test and validate the sample code

  1. Verify your read access to the tabular data source Adventure Works DW Tabular SQL 2012 RC0. .
    1. Open SQL Server Data Tools and connect to an Analysis Service instance. localhost, the default value, should be enough; if you are connecting to a remote server, ask your DBA for server name and instance.
    2. Expand the Databases folder.
    3. Locate the Adventure Works DW Tabular SQL 2012 RC0 database.

    If you don't see the database, this might be because the database is not installed in the server or you don't have privileges to access the database; contact your DBA to help you to gain access to the database.

    1. Right click on Adventure Works DW Tabular SQL 2012 RC0 and select New Query, MDX. On the rightmost pane write:
      Select Measures.[Total Sales] on columns
      from [Model]
    2. Press F5 or the Execute button. You should see results in the results pane below.
    3. If no rows are returned or an error occurs contact your DBA to obtain help.
  2. Open the folder that contains the solution files.
  3. Double click the solution file: Querying a Tabular Model.sln.
    If it doesn't open Visual Studio 2010 then the feature wasn't correctly installed; you need to go over the setup process and install Visual Studio 2010 again.
  4. Once the solution is open, in the Solution Explorer, right click over the References folder and select Microsoft.AnalysisServices.AdomeClient. If a warning sign appears with the label, you need to recreate the reference; otherwise you should be good to continue.
  5. If you need to recreate the reference to the latest build of Microsoft.AnalysisServices.dll of RC0 or later version; the file should be located at C:\Program Files (x86)\Microsoft.NET\ADOMD.NET\110\Microsoft.AnalysisServices.AdomdClient.dll.
     Caution:
    This sample requires the SQL Server 2012 RC0  or later version of Microsoft.AdomdClient.dll to compile and work.
  6. Click on Build, from the menu bar, and select Rebuild Solution. Wait until the solution is compiled.
  7. Click on Debug, from the menu bar, and select Start Debugging. Wait until the form appears on the screen.
  8. Your sample application is functional

Requirements

Requirements to install and deploy Adventure Works DW Tabular Denali sample database and project:

  • Windows 7 or Windows 2008 R2
  • Visual Studio 2010 Professional or Visual Studio Express 2010, with C# language installed.
  • SQL Server Analysis Services 2012 RC0, an instance deployed in tabular mode.
  • SQL Server Data Tools 2012 RC0, a feature to install when installing SQL Server.
  • Read access to an instance of Adventure Works DW Tabular SQL 2012 RC0 database.

Back to top

See Also

Power View Overview