Wednesday, March 10, 2010

Using PowerPivot’s Copy-Paste Support for Importing Data from Word

One of the great features of SQL Server PowerPivot is that it supports importing data directly from the clipboard. This is quite handy in cases you want to import and analyze data fast.

An example of using the above feature is importing data from Microsoft Word. Let’s say you have a Word document containing the following table:

The scenario here is to import the data from Word and perform a simple analysis.

The first step is to select the entire table and copy its contents to the clipboard.

Then you have to launch Excel 2010 and open the PowerPivot window:


Click on “To New Table” and you will be presented with a Paste Preview dialog in which you will be able to see the contents of the clipboard and how they are “translated” by the PowerPivot engine:

At the bottom of the dialog you can choose to use the first row as column names and that’s what I did in this example.

You then click on “OK” and you are presented with the data as imported into PowerPivot:


Next, by clicking on the “PivotTable” button you are presented with various options regarding what type(s) of pivot tables you can create:
For this example I chose to use a “Single PivotChart”.

Then, the PowerPivot dialog closes and the Excel worksheet is presented containing the pivot table:

You can then easily perform aggregations using the tools provided by PowerPivot:


Well, I guess that’s it for today! I hope you found this post useful!

Another post on copy-paste and PowerPivot is coming where we will see how we can copy-paste two tables from Word and build relationships on the data.
Check out my latest eBook on SQL Server:
Tuning SQL Server - Ebook

Easily secure your SQL Server instances! Try out DBA Security Advisor!
DBA Security Advisor for SQL Server by SQLArtBits
DBA Security Advisor was developed by SQLArtBits. The tool was being carefully developed for an entire year and it contains comprehensive security checks and recommendations based on proven SQL Server security best practices. Feel free to download and use the Community Edition which is free and if you find it useful, you can consider upgrading to the Enterprise Edition!

Artemakis Artemiou [MVP]

Author & Editor

Artemakis Artemiou is a Senior SQL Server Architect, Software Developer and Microsoft Data Platform MVP. He is also an author, regular blogger, president of Cyprus.NET User Group and CY Country leader of INETA-EU. He is also the creator of DBA Security Advisor and In-Memory OLTP Simulator. Artemakis is a frequent guest author of worldwide well-respected online journals where he writes articles focusing on many SQL Server topics.

Reference: The SQL Server and .NET Hub (