<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Arcane Code</title>
	<atom:link href="http://arcanecode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://arcanecode.com</link>
	<description>Making Microsoft .Net Development Magical</description>
	<lastBuildDate>Thu, 28 Jan 2010 00:15:46 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='arcanecode.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5dbb9d6fd6d280b43f076184a66eff27?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Arcane Code</title>
		<link>http://arcanecode.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://arcanecode.com/osd.xml" title="Arcane Code" />
		<item>
		<title>Alabama Code Camp Mobile 2010</title>
		<link>http://arcanecode.com/2010/01/27/alabama-code-camp-mobile-2010/</link>
		<comments>http://arcanecode.com/2010/01/27/alabama-code-camp-mobile-2010/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 00:15:46 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[FTS]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Analysis Services]]></category>
		<category><![CDATA[SQL Server Full Text Searching]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SQL Server Reporting Services]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[SSRS]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2010/01/27/alabama-code-camp-mobile-2010/</guid>
		<description><![CDATA[Last Saturday was the Alabama Code Camp, held in Mobile AL. For those unfamiliar with the Alabama Code Camps, we hold on average two a year, and they shift from city to city with different user groups acting as the host group. Other cities include Huntsville, Birmingham, and Montgomery. This time though the Lower Alabama [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1795&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Last Saturday was the Alabama Code Camp, held in Mobile AL. For those unfamiliar with the Alabama Code Camps, we hold on average two a year, and they shift from city to city with different user groups acting as the host group. Other cities include Huntsville, Birmingham, and Montgomery. This time though the Lower Alabama Dot Net User Group under the leadership of Ryan Duclos hosted, and what a great event it was. Everything ran smoothly, there was plenty of drinks and pizza to go around, and some good swag to boot. A big congrats to Ryan and his team of volunteers for a great event, also thanks to Microsoft for sponsoring and the University of South Alabama for the venue. </p>
<p>I was kept busy at this code camp, doing three sessions. The first session was “Introduction to Microsoft PowerPivot”. The slide deck can be found at <a title="http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf" href="http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf">http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf</a>. To see all my PowerPivot posts, simply pick it in the categories to the right or use this link: <a title="http://arcanecode.com/category/powerpivot/" href="http://arcanecode.com/category/powerpivot/">http://arcanecode.com/category/powerpivot/</a>. </p>
<p>My second session was on Full Text Searching. You can find code samples and the PDF for the presentation at my code gallery site, <a title="http://code.msdn.microsoft.com/SqlServerFTS" href="http://code.msdn.microsoft.com/SqlServerFTS">http://code.msdn.microsoft.com/SqlServerFTS</a>.</p>
<p>The final presentation was an introduction to Business Intelligence and Data Warehousing. <a href="http://arcanecode.files.wordpress.com/2010/01/introtodatawarehousing.pdf">Here is the link</a> to the presentations slides in PDF format. As promised in the session I added the additional information for the Kimball Group book. </p>
<p>A quick apology for my delay in posting, a nasty head cold has had me in Zombie land since I got back. Thanks to all who attended, I appreciate you being very interactive, lots of questions, and very attentive. I look forward to the next time Mobile hosts the Alabama Code Camp. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1795/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1795&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2010/01/27/alabama-code-camp-mobile-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerPivot for Excel 2010 at the Steel City SQL Users Group January 19, 2009</title>
		<link>http://arcanecode.com/2010/01/19/powerpivot-for-excel-2010-at-the-steel-city-sql-users-group-january-19-2009/</link>
		<comments>http://arcanecode.com/2010/01/19/powerpivot-for-excel-2010-at-the-steel-city-sql-users-group-january-19-2009/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 00:25:19 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2010/01/19/powerpivot-for-excel-2010-at-the-steel-city-sql-users-group-january-19-2009/</guid>
		<description><![CDATA[Today I am at the Steel City SQL Users Group, presenting on Microsoft’s newest BI Tool, PowerPivot. 
The slide deck for this meeting can be found at:
http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf
To see all my posts so far on PowerPivot, you can use the link below to filter.
http://arcanecode.com/category/powerpivot/
Thanks for coming!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1793&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Today I am at the Steel City SQL Users Group, presenting on Microsoft’s newest BI Tool, PowerPivot. </p>
<p>The slide deck for this meeting can be found at:</p>
<p><a title="http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf" href="http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf">http://arcanecode.files.wordpress.com/2010/01/powerpivot_long.pdf</a></p>
<p>To see all my posts so far on PowerPivot, you can use the link below to filter.</p>
<p><a title="http://arcanecode.com/category/powerpivot/" href="http://arcanecode.com/category/powerpivot/">http://arcanecode.com/category/powerpivot/</a></p>
<p>Thanks for coming!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1793/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1793/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1793/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1793/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1793/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1793/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1793/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1793/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1793/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1793/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1793&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2010/01/19/powerpivot-for-excel-2010-at-the-steel-city-sql-users-group-january-19-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS For Developers at Huntsville New Technology User Group</title>
		<link>http://arcanecode.com/2010/01/18/ssis-for-developers-at-huntsville-new-technology-user-group/</link>
		<comments>http://arcanecode.com/2010/01/18/ssis-for-developers-at-huntsville-new-technology-user-group/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 22:00:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2010/01/18/ssis-for-developers-at-huntsville-new-technology-user-group/</guid>
		<description><![CDATA[On Monday night January 18, 2010 I will be presenting “SSIS for Developers” at HUNTUG, The Huntsville New Technology Users Group. The meeting kicks off at 6 pm, and we’d love to see you there. Their website has all the location information. 
We&#8217;ve all been there. We develop a new system to replace some older [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1791&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>On Monday night January 18, 2010 I will be presenting “SSIS for Developers” at HUNTUG, <a href="http://huntug.org/" target="_blank">The Huntsville New Technology Users Group</a>. The meeting kicks off at 6 pm, and we’d love to see you there. Their website has all the location information. </p>
<p>We&#8217;ve all been there. We develop a new system to replace some older system long overdue for retirement. The dread always comes around the data conversion step. Having to figure out the quickest, easiest way to get the data from the old system to the new. Or perhaps they have intense data processing that would be better handled by SQL Server, but is too complex for a T-SQL stored procedure. Importing data into their database from an external source, or performing complex data processing over large datasets. </p>
<p>What most developers don&#8217;t realize is that they already have an extremely powerful tool to solve both these and other problems: SQL Server Integration Services. SSIS isn&#8217;t just for feeding your warehouse, it&#8217;s also a great tool for data migration and processing. Come get an introduction and learn how you can be using SSIS for your projects.</p>
<p>The slide deck and main demo can be found at my Code Gallery site:</p>
<p><a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&amp;ReleaseId=2883">https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&amp;ReleaseId=2883</a></p>
<p>The calling of SSIS from .Net demo can be found at:</p>
<p><a href="http://code.msdn.microsoft.com/ssisfromnet">http://code.msdn.microsoft.com/ssisfromnet</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1791/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1791&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2010/01/18/ssis-for-developers-at-huntsville-new-technology-user-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>Refreshing PowerPivot Data</title>
		<link>http://arcanecode.com/2009/12/09/refreshing-powerpivot-data/</link>
		<comments>http://arcanecode.com/2009/12/09/refreshing-powerpivot-data/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 07:09:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/12/09/refreshing-powerpivot-data/</guid>
		<description><![CDATA[If you remember my Intro to PowerPivot post, you’ll recall that every organization has that power user who leveraged the tools he had on hand, mostly Excel, to do their own form of Business Intelligence. One headache that plagued “that guy” was the freshness of data. It could be quite difficult to keep the data [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1790&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>If you remember my Intro to PowerPivot post, you’ll recall that every organization has that power user who leveraged the tools he had on hand, mostly Excel, to do their own form of Business Intelligence. One headache that plagued “that guy” was the freshness of data. It could be quite difficult to keep the data used in his or her spreadsheets up to date. One of the great boons that PowerPivot offers is the ability to quickly and easily refresh data. </p>
<p>Once again let’s return to the Excel 2010 spreadsheet we created in my Combining Data from Multiple Sources in PowerPivot. In this example we’ll put ourselves in the role of a salesperson, creating an analysis for one of our best customers, one Lucy Harrington. Going to the <i>Customer</i> tab in our PowerPivot workbook, we click on the drop down menu for the <i>FirstName</i> column. Clear the “Select All” option then scroll down and only check the first name “Lucy” which should be sufficient to find only the customer we wish.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0012.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb2.jpg?w=318&#038;h=369" width="318" height="369" /></a></p>
<p>In looking at her record, we are horrified to see that some nit-wit in data entry had improperly given our best customer the title of “Mr.” even though we know Lucy is not only a “Mrs.” but as a newlywed very insistent on the use of the Mrs. title. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0022.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb2.jpg?w=388&#038;h=69" width="388" height="69" /></a></p>
<p>Correcting this is easy enough, in the source system we can go make the fix, or perhaps we bribe the DBA with lunch so he’ll make our data fix a high priority and issue this update command to the database:</p>
<pre class="code"><span style="color:blue;">UPDATE </span>SalesLT<span style="color:gray;">.</span>Customer
   <span style="color:blue;">SET </span>Title <span style="color:gray;">= </span><span style="color:red;">'Mrs.'
 </span><span style="color:blue;">WHERE </span>FirstName <span style="color:gray;">= </span><span style="color:red;">'Lucy'
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>So now how do we refresh our data in PowerPivot? Easy enough. In PowerPivot on the Home tab you’ll notice a <i>Refresh</i> button in the <i>Connections</i> group. Clicking on it gives us two options, one to refresh just the current table we are viewing, another to refresh all of the tables in our PowerPivot work area. For this example we’ll pick just the <i>Refresh</i> command. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0031.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image003" border="0" alt="clip_image003" src="http://arcanecode.files.wordpress.com/2009/12/clip_image003_thumb1.jpg?w=316&#038;h=192" width="316" height="192" /></a></p>
<p>Once you pick Refresh the <i>Data Refresh</i> dialog appears to let you know of its progress. When done it will let you know of its success and you can then click the Close button to close the window. At this point you’ll see some behavior that I can only attribute to the fact that as of this writing PowerPivot is still in the CTP stage. My screen flashed a few times, then when it was done I was on the last tab in my PowerPivot workbook, the CountryInfo tab. Simply click on the Customer tab to return. </p>
<p>A great thing about the Refresh is that it left our filters intact, you’ll see we are still only looking at Lucy’s, and even better we can see the title of our best customer is now corrected:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0041.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image004" border="0" alt="clip_image004" src="http://arcanecode.files.wordpress.com/2009/12/clip_image004_thumb1.jpg?w=387&#038;h=69" width="387" height="69" /></a></p>
<p>If you’re using the same sheet from the previous lessons, you will also notice the calculated column we’d put in place, <i>FullName</i>, is still present. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image005.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image005" border="0" alt="clip_image005" src="http://arcanecode.files.wordpress.com/2009/12/clip_image005_thumb.jpg?w=163&#038;h=71" width="163" height="71" /></a></p>
<p><b>A word of caution.</b></p>
<p>When using the Refresh feature, be aware that every time you do a refresh you are pulling the entire dataset back, not just the changed rows. Using SQL Server Profile I monitored the Refresh operation from the server side, and found the query issues was:</p>
<pre class="code"><span style="color:blue;">SELECT </span>[SalesLT]<span style="color:gray;">.</span>[Customer]<span style="color:gray;">.*
  </span><span style="color:blue;">FROM </span>[SalesLT]<span style="color:gray;">.</span>[Customer]</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>If you were to attempt this on a large table in your production system during a busy production time it could have severely negative consequences. Imagine the slowdown that would occur if this were executed against a system having hundreds of millions of rows. </p>
<p>When getting into data sets that large, I would advise moving towards a more structured data warehousing environment. This would provide a structure better suited for analysis. If nothing else though, get IT to setup a copy of the production system in a location updated during off peak hours so that analysts could pull massive amounts of data without impacting production systems. </p>
<p><b>Summary</b></p>
<p>Taking into account the strain on the source systems, the easy one button refresh does provide a great way for analysts to ensure the data they are making business decisions from is current and up to date. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1790/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1790&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/12/09/refreshing-powerpivot-data/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb2.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb2.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image003_thumb1.jpg" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image004_thumb1.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image005_thumb.jpg" medium="image">
			<media:title type="html">clip_image005</media:title>
		</media:content>
	</item>
		<item>
		<title>Lookups in PowerPivot Calculated Columns &#8211; Using the RELATED Function</title>
		<link>http://arcanecode.com/2009/12/07/lookups-in-powerpivot-calculated-columns-using-the-related-function/</link>
		<comments>http://arcanecode.com/2009/12/07/lookups-in-powerpivot-calculated-columns-using-the-related-function/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 07:07:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/12/07/lookups-in-powerpivot-calculated-columns-using-the-related-function/</guid>
		<description><![CDATA[In my previous post we looked at how Calculated Columns work in PowerPivot. One limitation you may have noticed though was all of the calculations were done using values in that individual table. What if you wanted to lookup a value in second table, based on a value in the first table, and return a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1779&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>In my previous post we looked at how Calculated Columns work in PowerPivot. One limitation you may have noticed though was all of the calculations were done using values in that individual table. What if you wanted to lookup a value in second table, based on a value in the first table, and return a value from that second table. Yes Virginia, not only is there a Santa Clause but there’s also an answer for us in PowerPivot’s RELATED function. </p>
<p>In addition to the standard Excel functions, PowerPivot provides a set of its own functions for working with its data. These new functions are collectively known as <i>Data Analysis eXpressions</i>, or <i>DAX</i> for short. By now you’ve probably guessed that the first function from the DAX toolbox you’ll want to learn is the <b><i>RELATED</i></b> function.</p>
<p>Let’s start with the same Excel 2010 workbook we had at the end of the lesson <a href="http://arcanecode.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/">Combining Data from Multiple Sources in PowerPivot</a>. If you recall we had imported data from the AdventureWorksLT2008 database. To that we added data the <i>CountryInfo</i> table, which we’d typed in to an Excel spreadsheet. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0011.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb1.jpg?w=244&#038;h=69" width="244" height="69" /></a></p>
<p>At the time we used this to get the <i>CountryAbbr</i> column, and you may have wondered why we also included a <i>DiscountRate</i> column. It’s this lesson where this <i>DiscountRate</i> will come in to play. </p>
<p>If you recall from that post, we used PowerPivot’s <i>Manage Relationships</i> feature to create a link that ultimately connected the <i>SalesOrderDetail</i> table to the <i>CountryInfo</i> table. This groundwork enables us to lookup values very easily. Here is a simple example. Go to the <i>Add Column</i> column of <i>SalesOrderDetail</i> and enter this formula into the fx area:</p>
<p><font face="Courier New">=RELATED(&#8216;CountryInfo&#8217;[CountryAbbr])</font></p>
<p>When PowerPivot gets done, the abbreviation for each country to be shipped to appears in this column. This can be used to “flatten out” some of your data. However it’s much more useful when used as part of a calculation. Delete the column we just added (right click on the column header and pick <i>Delete Column</i> from the menu). </p>
<p>Looking in the <i>CountryInfo</i> table we see the <i>DiscountRate</i>. A value of 0.04 means our US customers get a discount of 4% off their <i>LineTotal</i>. So in our <i>SalesOrderDetail</i> table we want to take the <i>LineTotal</i> and calculate a new value based on the rate, which is stored in the <i>CountryInfo</i> table. Simple enough using the PowerPivot <b>RELATED</b> function.</p>
<p><font face="Courier New">=[LineTotal] * (1 &#8211; RELATED(&#8216;CountryInfo&#8217;[DiscountRate]))</font></p>
<p>This is fairly simple math, we take the DiscountRate from CountryInfo (for US, 0.04) and subtract from 1 giving us 0.96, or 96%. This is then multiplied by the LineTotal giving us our new discounted LineTotal amount, which I renamed to <i>DiscountedLineTotal</i>. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0021.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb1.jpg?w=244&#038;h=125" width="244" height="125" /></a></p>
<p>Hopefully these simple examples will give you a glimpse of the immense power RELATED offers. It will allow you to combine data from multiple tables to create in-depth analysis that previously required a specialist in Business Intelligence to create. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1779/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1779&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/12/07/lookups-in-powerpivot-calculated-columns-using-the-related-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb1.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb1.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>
	</item>
		<item>
		<title>Calculated Columns in PowerPivot</title>
		<link>http://arcanecode.com/2009/12/04/calculated-columns-in-powerpivot/</link>
		<comments>http://arcanecode.com/2009/12/04/calculated-columns-in-powerpivot/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 07:14:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/12/04/calculated-columns-in-powerpivot/</guid>
		<description><![CDATA[When importing data into PowerPivot, users often find the data is almost, but not quite what they need. Perhaps the name is not quite formatted as they need, or some calculation, not important in the stored data but very important to their work, is missing. For these situations PowerPivot offers Calculated Columns.
Calculated Columns provide a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1773&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>When importing data into PowerPivot, users often find the data is almost, but not quite what they need. Perhaps the name is not quite formatted as they need, or some calculation, not important in the stored data but very important to their work, is missing. For these situations PowerPivot offers <i>Calculated Columns</i>.</p>
<p>Calculated Columns provide a way for users to add that missing information they require into the source data. The calculations are done on a row by row basis, if you want to do something on the entire table, for example count the number of rows, you will instead need to create a <i>measure</i> in your PivotTable or PivotChart. Measures will be covered in a later post. </p>
<p>Let’s get started by using the same Excel 2010 workbook we ended with in the previous blog post. If you haven’t seen it, please go back and reference my post <a href="http://arcanecode.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/">Combining Data from Multiple Sources in PowerPivot</a> for the full details. </p>
<p>Our first task will be to address our customer names. In the source data, names are broken into five columns: Title, FirstName, MiddleName, LastName, and Suffix. For ease of use we wish to combine these distinct columns into one single column. Assuming you have opened the PowerPivot workbook, select the <i>Customer</i> table from the list of tabs at the bottom. Now go to the right-most column, <i>ModifiedDate</i>. Next to it you’ll see a blank column with the header “<i>Add Column”</i>. Click in it, then go up to the fx box right above the data. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0016.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image001[6]" border="0" alt="clip_image001[6]" src="http://arcanecode.files.wordpress.com/2009/12/clip_image0016_thumb.jpg?w=119&#038;h=70" width="119" height="70" /></a></p>
<p>The formula bar:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0026.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image002[6]" border="0" alt="clip_image002[6]" src="http://arcanecode.files.wordpress.com/2009/12/clip_image0026_thumb.jpg?w=149&#038;h=61" width="149" height="61" /></a></p>
<p>Into this formula bar we can create some fairly complex expressions. Let’s do one that shows some of the power of text formulas. Into the formula bar enter:</p>
<p><font face="Courier New">=[Title] &amp; &quot; &quot; &amp; [FirstName] &amp; &quot; &quot; &amp; IF(LEN([MiddleName]) &gt; 0, [MiddleName] &amp; &quot; &quot;, &quot;&quot;) &amp; [LastName] &amp; IF(LEN([Suffix]) &gt; 0, &quot; &quot; &amp; [Suffix], &quot;&quot;)</font></p>
<p>As with Excel, formulas need to begin with the equal sign. All literal string values are enclosed in double quote marks. Here we have two, a single space in the form of “ “ and an empty string in the form of “” (two double quotes right next to each other). The ampersand &amp; character is used for concatenation. When using column names in the formulas, they must be enclosed in square brackets <font face="Courier New">[ ]</font> . Finally notice we’ve leveraged some standard Excel functions, first the LEN function which returns the length of the past in field. Then the IF function which evaluates the first statement (for example, <font face="Courier New">LEN([MiddleName]) &gt; 0</font> ). Then the area after the first comma (<font face="Courier New">[MiddleName] &amp; &quot; &quot;</font> ) is returned if the statement was true, otherwise the area after the second comma (<font face="Courier New">&quot;&quot;</font> ) is returned. </p>
<p>After pressing enter on our formula PowerPivot will then calculate the values for each individual row in the dataset. The downside is this could take quite a while depending on the size of your data. A 100 million rows of data is going to take a while, even on a fast machine. The benefit though is this is the only time the calculation is done, unless of course the underlying data changes. Values are now calculated and available at analysis time. </p>
<p>You may notice the column name changes from <i>Add Column</i> to <i>CalculatedColumn1</i>. Since this is not something we’d want to show other users, or work with ourselves, simply right click on the column header, pick <i>Rename Column</i>, and give our new column a meaningful name. In this example I used <i>FullName</i>. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0036.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image003[6]" border="0" alt="clip_image003[6]" src="http://arcanecode.files.wordpress.com/2009/12/clip_image0036_thumb.jpg?w=161&#038;h=90" width="161" height="90" /></a></p>
<p>A quick side note, in the sample data the <i>MiddleName</i> and <i>Suffix</i> columns are not populated very often, as is often true with real data. However it can make browsing through our data a bit difficult. To validate our calculation, click the drop down menu triangle next to the MiddleName column, go to the bottom and uncheck the “Blank” option for data filtering. This will then remove all rows from the viewed data that are missing a middle name. </p>
<p>Note this doesn’t delete the rows, this is merely a filtering option in PowerPivot to help you view only the data you want. The other rows are still there, to prove it just click the menu arrow again and pick the “<i>Clear filter from MiddleName</i>” menu option and all rows will again be visible. For more information on filtering, see my post Import Filters in PowerPivot. The same filtering tools that apply to the data import process also work once the data is imported. </p>
<p>In addition to textual manipulation, PowerPivot also supports complex math calculations. Let’s do a simple example in the SalesOrderDetail tab. For simplicity, let’s decide that our base profit for any sale is 20 percent of the Line Total. However, for each item ordered we gain an extra 2 percent of profit. We’ll click in the <i>Add Column</i> area of the <i>SalesOrderDetail</i> tab and enter the following calculation:</p>
<p><font face="Courier New">=(.2 + ([OrderQty] * .02))*[LineTotal]</font></p>
<p>Now we can rename the column to <i>EstimatedProfit</i> using the rename menu option as described above. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0046.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image004[6]" border="0" alt="clip_image004[6]" src="http://arcanecode.files.wordpress.com/2009/12/clip_image0046_thumb.jpg?w=162&#038;h=157" width="162" height="157" /></a></p>
<p>We also have the power of the Excel math functions at our disposal. Let’s do something simple, and decide that we want to round the value of our EstimatedProfit column up to the next whole value. Even if the value was 1.01, it would round up to 2 dollars. To accomplish this we can use Excel’s <font face="Courier New">ROUNDUP</font> function:</p>
<p><font face="Courier New">=ROUNDUP((.2 + ([OrderQty] * .02))*[LineTotal], 0)</font></p>
<p>Yields these new results:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image0056.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="clip_image005[6]" border="0" alt="clip_image005[6]" src="http://arcanecode.files.wordpress.com/2009/12/clip_image0056_thumb.jpg?w=161&#038;h=158" width="161" height="158" /></a></p>
<p>As you can see, they have indeed been rounded up to the next whole value. The 0 at the end of the formula indicated how many decimals should remain, I indicated none so we could see the results in whole dollars.</p>
<p>We’ve only just begun to explore the value in Calculated Columns. Not only can they fill in missing data, but they can also speed calculations when you reach the Pivot Table stage of your analysis by making aggregations much easier. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1773/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1773/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1773/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1773&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/12/04/calculated-columns-in-powerpivot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image0016_thumb.jpg" medium="image">
			<media:title type="html">clip_image001[6]</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image0026_thumb.jpg" medium="image">
			<media:title type="html">clip_image002[6]</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image0036_thumb.jpg" medium="image">
			<media:title type="html">clip_image003[6]</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image0046_thumb.jpg" medium="image">
			<media:title type="html">clip_image004[6]</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image0056_thumb.jpg" medium="image">
			<media:title type="html">clip_image005[6]</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining Data from Multiple Data Sources in PowerPivot</title>
		<link>http://arcanecode.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/</link>
		<comments>http://arcanecode.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 07:15:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/</guid>
		<description><![CDATA[Seldom does the user of PowerPivot have all of the data they need in one nice, neat data source. More than often it will be necessary to import data from a variety of sources and make that data work together. It’s time to start building on what we’ve learned over the last few days to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1762&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Seldom does the user of PowerPivot have all of the data they need in one nice, neat data source. More than often it will be necessary to import data from a variety of sources and make that data work together. It’s time to start building on what we’ve learned over the last few days to accomplish this feat. </p>
<p>First, launch Excel 2010 and use the PowerPivot import wizard to import the following tables from the AdventureWorksLT2008 database: Address, Customer, CustomerAddress, Product, ProductCategory, SalesOrderDetail, SalesOrderHeader. (Note, for a refresher on importing data please see my blog post, <a href="http://arcanecode.com/2009/11/24/import-filters-in-powerpivot/">Import Filters in PowerPivot</a>.)</p>
<p>Now we need a second source of data. Follow the instructions in my post Creating Tables in PowerPivot to enter the data below into Excel 2010, copy and paste it into a new PowerPivot table. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image001.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb.jpg?w=309&#038;h=87" width="309" height="87" /></a></p>
<p>If you recall when we import data from a relational database, PowerPivot examines the foreign key relationships found in the database to create relationships between the tables it imports. In this situation though, the <i>CountryInfo</i> data didn’t get imported from a database, instead it was pasted in from a manually entered spreadsheet. Thus, PowerPivot has no information with which it can implicitly create a relationship. </p>
<p>We do want to create one however, so we can link the longer country name in the <i>Address</i> table to the <i>CountryInfo</i> data and thus be able to use the briefer country abbreviations. As PowerPivot was designed to work with many sources of data, it has an easy way to create these relationships. </p>
<p>In the PowerPivot window, click on the Table tab at the very top. All the way to the right you will notice a button group named <i>Relationships</i>. Click the <i>Create Relationship</i> button. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image002.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb.jpg?w=454&#038;h=231" width="454" height="231" /></a></p>
<p>As the above dialog shows, this allows you to create a relationship, or a link between two tables in PowerPivot. Here we are creating a link between the <i>Address</i> table and the <i>CountryInfo</i> table on the CountryRegion field. When complete just click Create to create the relationship. </p>
<p>If you want to verify the relationship was indeed created, or review any of the relationships PowerPivot inferred when it imported the tables from the AdventureWorksLT2008 database, just click the <i>Manage Relationships</i> button in the Table Toolbar’s Relationships group. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image003.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image003" border="0" alt="clip_image003" src="http://arcanecode.files.wordpress.com/2009/12/clip_image003_thumb.jpg?w=531&#038;h=348" width="531" height="348" /></a></p>
<p>On the very first row you’ll see the newly created relationship between the Address and CountryInfo tables. You’ll also see the other relationships that were created during the import process from the SQL Server database. The three buttons at the top let us Create new relationships, Edit existing ones, or Delete ones no longer needed. Note that the altering or deleting of relationships has no effect what so ever on the original source data (SQL Server or the Excel 2010 spreadsheet). It only affects the tables as stored in PowerPivot. </p>
<p>Now let’s see the new relationship in action. Close the <i>Manage Relationships</i> window, and on the PowerPivot Home tab create a new PowerPivot table (Pivot Table, Single Pivot Table). Go ahead and put it in a new worksheet. </p>
<p>In the Gemini Task Pane, go to the SalesOrderHeader table and drag the LineTotal field into the Values area. Next, drag the Name field from the Product table into the Row Labels area. Now for the magic, in the CountryInfo table drag the CountryAbbr field into the Column Labels area. Your pivot table should look something like this:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/12/clip_image004.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image004" border="0" alt="clip_image004" src="http://arcanecode.files.wordpress.com/2009/12/clip_image004_thumb.jpg?w=516&#038;h=170" width="516" height="170" /></a></p>
<p>Because of the relationships that were inferred or that we created, PowerPivot was able to link the data like so:</p>
<p>1. SalesOrderDetail linked to SalesOrderHeader on the SalesOrderID column.</p>
<p>2. SalesOrderHeader linked to Address on the ShipToAddressID=AddressID.</p>
<p>3. Address linked to ContryInfo on the CountryRegion column. </p>
<p>To validate this for yourself, just return to PowerPivot and look at the Manage Relationships dialog to see all the links. </p>
<p>The need to combine data from many sources is a common task, one that will most certainly be done by users of PowerPivot. Using the techniques shown here, you can create and manage the relationships that will link data from these disparate sources together and leverage the power of PowerPivot.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1762/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1762/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1762/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1762/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1762/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1762/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1762/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1762/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1762/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1762/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1762&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/12/02/combining-data-from-multiple-data-sources-in-powerpivot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image001_thumb.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image002_thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image003_thumb.jpg" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/12/clip_image004_thumb.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating Tables in PowerPivot</title>
		<link>http://arcanecode.com/2009/11/30/creating-tables-in-powerpivot/</link>
		<comments>http://arcanecode.com/2009/11/30/creating-tables-in-powerpivot/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 05:10:51 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/30/creating-tables-in-powerpivot/</guid>
		<description><![CDATA[PowerPivot has the ability to import data from a wide variety of sources. But you could run across a situation where you don’t have that data stored anywhere. Perhaps it’s on a piece of paper, or in a text file, or it’s just in the user’s brain and needs to be typed in. Logically then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1753&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>PowerPivot has the ability to import data from a wide variety of sources. But you could run across a situation where you don’t have that data stored anywhere. Perhaps it’s on a piece of paper, or in a text file, or it’s just in the user’s brain and needs to be typed in. Logically then you would want to create a new table in PowerPivot. </p>
<p>Except you can’t. PowerPivot itself doesn’t provide the ability to create tables and enter data directly into it. Now, before you start the usual rending of garments and gnashing of teeth plus a little wailing, there is a simple to implement solution. </p>
<p>Create a new Excel 2010 workbook. In sheet 1 (or any sheet) let’s enter the following information. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image0011.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/11/clip_image001_thumb1.jpg?w=309&#038;h=87" width="309" height="87" /></a></p>
<p>Now highlight the above cells and Copy them to the clipboard. Next, launch the PowerPivot window by going to the PowerPivot tab in Excel 2010 and clicking the PowerPivot window button. </p>
<p>Once PowerPivot is open, if you look in the middle group of buttons you’ll see a set named <i>Paste from Clipboard</i> The <i>To New Table</i> button should be activated now that you have data in your clipboard.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image0021.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/11/clip_image002_thumb1.jpg?w=155&#038;h=93" width="155" height="93" /></a></p>
<p>Click the <i>To New Table</i> button. When you do, the Paste Preview dialog appears. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image0031.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image003" border="0" alt="clip_image003" src="http://arcanecode.files.wordpress.com/2009/11/clip_image003_thumb1.jpg?w=436&#038;h=362" width="436" height="362" /></a></p>
<p>This is similar to the preview window you see with the Import Table wizard, only not quite as much functionality. Here, we can view the data and validate that it is correct, which it is. We can also indicate if the first row contains our column headers, which in our case it does so we can just leave that option checked on. Click OK to import the data. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image0041.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image004" border="0" alt="clip_image004" src="http://arcanecode.files.wordpress.com/2009/11/clip_image004_thumb1.jpg?w=393&#038;h=147" width="393" height="147" /></a></p>
<p>Above is our new data, now pasted into PowerPivot. We have the same abilities with it we have with any other table, we can sort, rename our columns, add new calculated columns, and more. As you will note from the tab at the bottom of the picture, the data was pasted into a table with the rather uninformative name of <i>Table</i>. We can do better than that, so right click on the <i>Table</i> tab and pick <i>Rename</i> from the menu. Overwrite <i>Table</i> with <i>CountryInfo</i>.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image0051.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image005" border="0" alt="clip_image005" src="http://arcanecode.files.wordpress.com/2009/11/clip_image005_thumb1.jpg?w=170&#038;h=99" width="170" height="99" /></a></p>
<p>Now you can see how easy it is to create new data from scratch and paste it into PowerPivot. In this example I used a limited number of rows for illustrative purposes, but it’s quite possible to import massive amounts of data. In addition, you can add to your table later. In this example all we would have had to do is <i>Paste Append</i> from the toolbar. </p>
<p>In the next blog post we’ll build on what we’ve learned and look at how to combine data imported from multiple sources. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1753/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1753&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/30/creating-tables-in-powerpivot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image001_thumb1.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image002_thumb1.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image003_thumb1.jpg" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image004_thumb1.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image005_thumb1.jpg" medium="image">
			<media:title type="html">clip_image005</media:title>
		</media:content>
	</item>
		<item>
		<title>Import Filters in PowerPivot</title>
		<link>http://arcanecode.com/2009/11/24/import-filters-in-powerpivot/</link>
		<comments>http://arcanecode.com/2009/11/24/import-filters-in-powerpivot/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 07:11:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Excel 2010]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/24/import-filters-in-powerpivot/</guid>
		<description><![CDATA[PowerPivot has the ability to import millions of rows of data into Excel 2010 for purposes of analyzing, slicing and dicing. However, even though you can import vast amounts of data you may not always want to. There are many reasons for this.
You may wish to limit the amount of data for security reasons. Perhaps [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1742&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>PowerPivot has the ability to import millions of rows of data into Excel 2010 for purposes of analyzing, slicing and dicing. However, even though you can import vast amounts of data you may not always want to. There are many reasons for this.</p>
<p>You may wish to limit the amount of data for security reasons. Perhaps bringing in all of the data may put an unneeded strain on the server. Most likely though, is you simply do not need all of the data. As an analyst you may be interested in only the data for a segment of your organization, such as a single plant or department. </p>
<p>Fortunately filtering data is an easy task. If you are not familiar with importing data into PowerPivot, may I suggest you first review my <a href="http://arcanecode.com/2009/11/23/sharepoint-saturday-birmingham-intro-to-microsoft-powerpivot/">step by step</a> posted yesterday. </p>
<p>Launch Excel 2010 and go to the PowerPivot tab, then launch the PowerPivot window. Select the &quot;From Database&quot; to start the import process, and for this example we&#8217;ll use SQL Server. Now, like in my previous blog post enter your credentials to connect to a SQL Server. For this example we&#8217;ll just pick one table, SalesOrderDetail from the AdventureWorksLT2008 database. </p>
<p>With the SalesOrderDetail picked, look in the lower right side of the dialog. You will see a button labeled &quot;<i>Preview &amp; Filter</i>&quot;.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image001.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/11/clip_image001_thumb.jpg?w=475&#038;h=484" width="475" height="484" /></a></p>
<p>When you click that button you should see a new dialog appear. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image002.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/11/clip_image002_thumb.jpg?w=538&#038;h=493" width="538" height="493" /></a></p>
<p>Here you can see a subset of your data, only the first few rows. It&#8217;s enough to give you an idea of what the data looks like, but it won&#8217;t show you every single row. Considering the fact that PowerPivot is capable of importing millions of rows, this is probably a good thing. </p>
<p>Within this dialog we can do some pretty powerful things. Let&#8217;s start by eliminating a column we don&#8217;t need in the data we want to import. Scroll to the right until you see the <i>rowguid</i> column and uncheck the box next to the column header, as you see below.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image003.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image003" border="0" alt="clip_image003" src="http://arcanecode.files.wordpress.com/2009/11/clip_image003_thumb.jpg?w=487&#038;h=349" width="487" height="349" /></a></p>
<p>By unchecking this box this column will not be imported into our Excel 2010 PowerPivot table. </p>
<p>Recall though that the name of this dialog was <i><u>Preview</u></i> &amp; Filter. We can also do some review of our data to ensure it&#8217;s what we want. Let&#8217;s say we want to look to see the range of values for our line totals. Click the downward facing triangle button to the right of the LineTotal column header. A drop down menu will appear. Select &quot;<i>Sort Smallest to Largest</i>&quot;</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image004.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image004" border="0" alt="clip_image004" src="http://arcanecode.files.wordpress.com/2009/11/clip_image004_thumb.jpg?w=323&#038;h=378" width="323" height="378" /></a></p>
<p>Scrolling through the data you&#8217;ll notice that the data has indeed been sorted. Also note the menu icon to the right of the column name changes to indicate a sort has been applied to this column. (Remember though it&#8217;s not showing <i>all</i> rows, just the first few sorted in order.) An important thing to note tough, this sorting applies only to the data as you see it in the <i>Preview &amp; Filter</i> area, once you click the Finish button on the <i>Table Import Wizard</i> the sort is removed. While the preview options in this dialog are not saved, filters are. If you had pressed Finished, you&#8217;d have seen that <i>rowguid</i> is not included in the result set. But don&#8217;t click Finish yet, we&#8217;re not quite done filtering. </p>
<p>For our next filter, let&#8217;s decide for purposes of this report we are only interested in large orders. We&#8217;ll define large as &quot;Line Total greater than 1,000 dollars&quot;. Once again open the menu to the right of the <i>LineTotal</i> column header and select &quot;<i>Number Filters</i>&quot;. A pop out menu will appear, from it select &quot;<i>Greater Than&#8230;</i>&quot;</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image005.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image005" border="0" alt="clip_image005" src="http://arcanecode.files.wordpress.com/2009/11/clip_image005_thumb.jpg?w=527&#038;h=326" width="527" height="326" /></a></p>
<p>When the Custom Filter pops up, enter <i>1000</i> next to the <i>is greater than</i> box and click OK. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image006.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image006" border="0" alt="clip_image006" src="http://arcanecode.files.wordpress.com/2009/11/clip_image006_thumb.jpg?w=441&#038;h=202" width="441" height="202" /></a></p>
<p>Clicking OK will reveal lesser amounts have been removed. Other filters besides numeric filters are available. For text data, you have &quot;<i>is equal to</i>&quot; and &quot;<i>is not equal to</i>&quot; available. Date filters work the same, having the &quot;<i>is equal to</i>&quot; and &quot;<i>is not equal to</i>&quot; available. I&#8217;m hopeful that for date types further functionality will be added in the future, such as date ranges or &quot;is greater/less than&quot; types of functionality. </p>
<p>Let&#8217;s click the OK button on the <i>Preview &amp; Filters</i> window to return to the <i>Table Import Wizard</i>. You&#8217;ll now see an <i>Applied filters</i> link in the row with the table name, click it to see what filters are in effect. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image007.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image007" border="0" alt="clip_image007" src="http://arcanecode.files.wordpress.com/2009/11/clip_image007_thumb.jpg?w=491&#038;h=74" width="491" height="74" /></a></p>
<p>When you click the link you&#8217;ll see:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/clip_image008.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="clip_image008" border="0" alt="clip_image008" src="http://arcanecode.files.wordpress.com/2009/11/clip_image008_thumb.jpg?w=405&#038;h=405" width="405" height="405" /></a></p>
<p>While you cannot edit this information, it is nice to see it all in one location. Click OK to close and return to the previous window. </p>
<p>Click Finish to complete the import. You will see the data you asked for, only rows with <i>LineTotal</i> greater than 1000 and without the <i>rowguid</i> column. </p>
<p>Hopefully you&#8217;ve seen how powerful the filtering tools included with PowerPivot are. Using them you can remove unwanted rows and columns, limiting not only the amount of data you have to pull across the network but that you have to store locally in the PowerPivot Excel 2010 spreadsheet. Limiting your data will ensure only the rows required for the analysis are included, saving time and enhancing security. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1742/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1742&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/24/import-filters-in-powerpivot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image001_thumb.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image002_thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image003_thumb.jpg" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image004_thumb.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image005_thumb.jpg" medium="image">
			<media:title type="html">clip_image005</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image006_thumb.jpg" medium="image">
			<media:title type="html">clip_image006</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image007_thumb.jpg" medium="image">
			<media:title type="html">clip_image007</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/clip_image008_thumb.jpg" medium="image">
			<media:title type="html">clip_image008</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Saturday Birmingham &#8211; Intro to Microsoft PowerPivot</title>
		<link>http://arcanecode.com/2009/11/23/sharepoint-saturday-birmingham-intro-to-microsoft-powerpivot/</link>
		<comments>http://arcanecode.com/2009/11/23/sharepoint-saturday-birmingham-intro-to-microsoft-powerpivot/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 07:02:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/23/sharepoint-saturday-birmingham-intro-to-microsoft-powerpivot/</guid>
		<description><![CDATA[ Last Saturday I not only attended but presented at SharePoint Saturday Birmingham. First I have to give Terry Webster a shout out, he did a fantastic job organizing and running the event. I learned a lot, although I admit I felt a bit like a fish out of water, being a SQL Server guy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1721&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p><a href="http://arcanecode.files.wordpress.com/2009/11/spsbham.jpg"><img style="display:inline;border:0;margin:0 0 0 10px;" title="spsbham" src="http://arcanecode.files.wordpress.com/2009/11/spsbham_thumb.jpg?w=230&#038;h=75" border="0" alt="spsbham" width="230" height="75" align="right" /></a> Last Saturday I not only attended but presented at SharePoint Saturday Birmingham. First I have to give Terry Webster a shout out, he did a fantastic job organizing and running the event. I learned a lot, although I admit I felt a bit like a fish out of water, being a SQL Server guy in the SharePoint pond.</p>
<p>Thanks too to all the volunteers who helped run the show, my co-presenters, and the many vendors who attended. Without the support of all those folks this event would not have been possible.</p>
<p>I also want to thank everyone who attended my PowerPivot presentation. Last Friday I did a rather <a href="http://arcanecode.com/2009/11/20/introducing-microsoft-powerpivot/">lengthy overview</a> that encapsulated much of my presentation;<a href="http://arcanecode.files.wordpress.com/2009/11/introductiontopowerpivot.pdf" target="_blank"> here are the slides</a> that you saw at the event.</p>
<p>I also want to give you a quick overview of the steps I did in my demo so you can follow along. First you’ll need the bits. The PowerPivotPro has a good blog entry on where to download them from:</p>
<p><a href="http://powerpivotpro.com/2009/11/18/powerpivot-ctp3-beta-download-links/">http://powerpivotpro.com/2009/11/18/powerpivot-ctp3-beta-download-links/</a></p>
<p>All you need are the first two items, Office 2010 Beta 2 and PowerPivot for Excel 2010 to reproduce what I did in the demo I presented.</p>
<p>Next you’ll need some data. I had a SQL Server instance installed and used the AdventureWorks2008 LT database available at CodePlex. The LT version is the light weight version of the full AdventureWorks sample, I chose it for it’s simplicity.</p>
<p><a href="http://msftdbprodsamples.codeplex.com/">http://msftdbprodsamples.codeplex.com/</a></p>
<p>If you don’t have SQL Server on your box you can use alternate data, or check with your friendly neighborhood DBA. Many have AdventureWorks installed on a test box and might be able to help you out.</p>
<p>OK, so to get this far you’ve downloaded and installed everything, and have access to a dataset. Ready? Let’s go.</p>
<p>1. Launch Excel 201, and click the PowerPivot tab.</p>
<p>2. Click the PowerPivot window button.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step01.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step01" src="http://arcanecode.files.wordpress.com/2009/11/step01_thumb.jpg?w=71&#038;h=89" border="0" alt="step01" width="71" height="89" /></a></p>
<p>3. Click the “From Database” button on the Home tab. In the menu select “From SQL Server”</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step02.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step02" src="http://arcanecode.files.wordpress.com/2009/11/step02_thumb.jpg?w=67&#038;h=70" border="0" alt="step02" width="67" height="70" /></a></p>
<p>4. The <em>Table Import Wizard</em> will appear. In “Server name” field, click the drop down and pick your database server. Leave it set to the “Use Windows Authentication” (unless told otherwise if you are using a database provided by a DBA). Under Database name, pick AdventureWorksLT2008. It’s probably a good idea to click the Test Connection button just to make sure everything is correct. If so press Next to continue.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step03.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step03" src="http://arcanecode.files.wordpress.com/2009/11/step03_thumb.jpg?w=538&#038;h=548" border="0" alt="step03" width="538" height="548" /></a></p>
<p>5. On the next screen, leave it at the default of “Select from a list of tables and views to choose the data to import” and click Next.</p>
<p>6. On the next screen pick these tables: SalesOrderDetail, SalesOrderHeader, Product, Product Category, Address, Customer, CustomerAddress. Note the “Preview &amp; Filter” button. In the future you may wish to experiment with this to filter the data you are importing, but it’s not needed for this demo. Click Finish to move on.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step04.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step04" src="http://arcanecode.files.wordpress.com/2009/11/step04_thumb.jpg?w=538&#038;h=548" border="0" alt="step04" width="538" height="548" /></a></p>
<p>7. On the next screen you’ll see it importing the tables. When it gives you the Success message click Close.</p>
<p>8. (Note, this next step differs just slightly from the live presentation, in it I added a column but did it in a different place.) Click on the SalesOrderDetail tab. Click on a blank cell under the Add Column out to the right of the data.</p>
<p>9. In this example we’ll decide that 80 percent of our Line Total is cost, which means the other 20% is profit. We’ll calculate the profit by clicking in the fx bar and typing <em>=[LineTotal]*.20</em></p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step05.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step05" src="http://arcanecode.files.wordpress.com/2009/11/step05_thumb.jpg?w=128&#038;h=26" border="0" alt="step05" width="128" height="26" /></a></p>
<p>10. Right click on the “CalculatedColumn1” column header and select “Rename column” from the menu. The column header will highlight and allow you to type over it. Change the name to <em>Profit</em>.</p>
<p>11. Click on PivotTable and pick “Single Pivot Table” in the drop down menu.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step06.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step06" src="http://arcanecode.files.wordpress.com/2009/11/step06_thumb.jpg?w=249&#038;h=391" border="0" alt="step06" width="249" height="391" /></a></p>
<p>12. In a pop up dialog, it will ask if you want a new or existing worksheet. Pick “New worksheet” and click OK.</p>
<p>13. Over on the right you will see the “Gemini Task Pane”. Gemini is the original code name for PowerPivot. To create a basic PowerPivot pivot table, follow these steps.</p>
<p>14. Under SalesOrderDetail, click on then drag the <em>LineTotal</em> and <em>Profit</em> fields to the Values area.</p>
<p>15. Under ProductCategory, drag the <em>Name</em> down to Row Labels.</p>
<p>16. Under Product drag the <em>Name</em> to the Row Labels area.</p>
<p>17. Under the Address, click and drag the CountryRegion, then StateProvince to the ColumnLabels area.</p>
<p>18. Drag the StateProvince to the Slicers Vertical area.</p>
<p>19. Your Gemini Task Pane should look something like:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step07.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step07" src="http://arcanecode.files.wordpress.com/2009/11/step07_thumb.jpg?w=255&#038;h=459" border="0" alt="step07" width="255" height="459" /></a></p>
<p>20. Your spreadsheet should look something like:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/step08.jpg"><img style="display:inline;border:0;margin:0 0 0 25px;" title="step08" src="http://arcanecode.files.wordpress.com/2009/11/step08_thumb.jpg?w=681&#038;h=253" border="0" alt="step08" width="681" height="253" /></a></p>
<p>At this point you have completed all of the steps as shown in the presentation. Now start playing. You can jump back to the PowerPivot data sheets by clicking the “PowerPivot window” button as shown in step 1. Back there you might try experimenting with a chart, or on the pivot table apply different effects and slicers.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1721&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/23/sharepoint-saturday-birmingham-intro-to-microsoft-powerpivot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/spsbham_thumb.jpg" medium="image">
			<media:title type="html">spsbham</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step01_thumb.jpg" medium="image">
			<media:title type="html">step01</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step02_thumb.jpg" medium="image">
			<media:title type="html">step02</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step03_thumb.jpg" medium="image">
			<media:title type="html">step03</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step04_thumb.jpg" medium="image">
			<media:title type="html">step04</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step05_thumb.jpg" medium="image">
			<media:title type="html">step05</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step06_thumb.jpg" medium="image">
			<media:title type="html">step06</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step07_thumb.jpg" medium="image">
			<media:title type="html">step07</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/step08_thumb.jpg" medium="image">
			<media:title type="html">step08</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing Microsoft PowerPivot</title>
		<link>http://arcanecode.com/2009/11/20/introducing-microsoft-powerpivot/</link>
		<comments>http://arcanecode.com/2009/11/20/introducing-microsoft-powerpivot/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 18:27:44 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Analysis Services]]></category>
		<category><![CDATA[SQL Server Reporting Services]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[SSRS]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/20/introducing-microsoft-powerpivot/</guid>
		<description><![CDATA[What is PowerPivot? Well according to Microsoft:
“PowerPivot is Microsoft Self-Service Business Intelligence”
I can see from the glazed looks you are giving your monitor that was clear as mud. So let’s step back a bit and first define what exactly is Business Intelligence.
Business Intelligence
Business Intelligence, often referred to as simply “BI”, is all about taking data [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1702&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>What is PowerPivot? Well according to Microsoft:</p>
<p><i><font size="4">“PowerPivot is Microsoft Self-Service Business Intelligence”</font></i></p>
<p>I can see from the glazed looks you are giving your monitor that was clear as mud. So let’s step back a bit and first define what exactly is <i>Business Intelligence</i>.</p>
<p><b>Business Intelligence</b></p>
<p>Business Intelligence, often referred to as simply “BI”, is all about taking data you already have and making sense of it. Being able to take that information and turn it from a raw jumble of individual facts and transform it into knowledge that you can take informed actions on. </p>
<p>In every organization there is already someone who is doing BI, although they may not realize it. Microsoft (and many IT departments) refer to this person as “<i>that guy</i>”. A power user, who grabs data from anyplace he (or she) can get it, then uses tools like Excel or Access to slice it, dice it, and analyze it. This person might be an actual Business Analyst, but more often it’s someone for who BI is not their main job. Some common examples of people doing their own BI today are production managers, accountants, engineers, or sales managers, all who need information to better do their job. Let’s look at an illustration that will make it a bit clearer.</p>
<p>In this example, put yourself in the role of a sales manager. You have gotten IT to extract all of your sales orders for the last several years into an Excel spreadsheet. In order to determine how well your sales people are doing, you need to measure their performance. You’ve decided that the amount sold will be a good measure, and use Excel to give you totals. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/introex01.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="IntroEx01" border="0" alt="IntroEx01" src="http://arcanecode.files.wordpress.com/2009/11/introex01_thumb.jpg?w=284&#038;h=104" width="284" height="104" /></a> </p>
<p>In BI terms, the column “Total Sales” is known as a <i>measure</i>, or sometimes a <i>fact</i>, as it measures something, in this case the sales amount. The grand total sales amount is often called an <i>aggregation</i>, as it totals up the individual rows of data that IT gave us. But now you might be wondering why Andy’s sales are so low? Well, now you want to dig deeper and look at sales by year. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/11/introex02.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="IntroEx02" border="0" alt="IntroEx02" src="http://arcanecode.files.wordpress.com/2009/11/introex02_thumb.jpg?w=419&#038;h=106" width="419" height="106" /></a> </p>
<p>In BI terms, the names of the sales people are a <i>dimension</i>. Dimensions are often either a “who” (who sold stuff) or a “what” (what stuff did we sell). Places (where was it sold) and dates (when was it sold) are also common dimensions. In this case the sales dates across the top (2007, 2008, 2009) are a date dimension. When we use two or more dimensions to look at our measures, we have a <i>pivot table</i>. </p>
<p>Now we can see a picture emerging. It’s obvious that Andy must have been hired as a new salesperson in late 2008, since he shows no sales for 2007 and very small amount in 2008. But for Paul and Kimberly we can look at something called <i>trends</i> in the BI world. Kimberly shows a nice even trend, rising slowly over the last three years and earns a gold star as our top performer. </p>
<p>By being able to drill down into our data, we spot another trend that was not readily obvious when just looking at the grand totals. Paul has been trending downward so fast the speed of light looks slow. Clearly then we now have information to take action on, commonly known as <i>actionable intelligence</i>.</p>
<p><b>So remind me, why do we need PowerPivot?</b></p>
<p>As you can see in the above example, “that guy” in your company clearly has a need to look at this data in order to do his job. Not only does he need to review it, he also has the issue of how to share this information with his co-workers. Unfortunately in the past the tools available to “that guy” have had some drawbacks. The two main tools used by our analyst have been either Excel, or a complete BI solution involving a data warehouse and SQL Server Analysis Services.</p>
<p>Excel’s main limitations center around the volume of data needed to do good analysis. Excel has limits to the number of rows it can store, and for large datasets a spreadsheet can consume equally large amounts of disk space. This makes the spreadsheet difficult to share with coworkers. In addition mathematical functions like aggregations could be slow. On the good side, Excel is readily available to most workers, and a solution can be put together fairly quickly. </p>
<p>A full blown BI solution has some major benefits over the Excel solution. A data warehouse is created, and then SQL Server Analysis Services (often abbreviated as SSAS) is used to precalculate aggregations for every possible way an analyst might wish to look at them. The data is then very easy to share via tools like Excel and SQL Server Reporting Services. While very robust and powerful solution, it does have some drawbacks. It can take quite a bit of time to design, code, and implement both the data warehouse and the analysis services pieces of the solution. In addition it can also be expensive for IT to implement such a system.</p>
<p><b>Faster than a speeding bullet, more powerful than a locomotive, it’s PowerPivot!</b></p>
<p>PowerPivot combines the best of both worlds. In fact, it’s not one tool but two: PowerPivot for Microsoft Excel 2010, and PowerPivot for SharePoint 2010. What’s the difference you ask? Good question. </p>
<p><b>PowerPivot for Microsoft Excel 2010</b></p>
<p>PowerPivot acts as an Add-on for Excel 2010, and in many ways is quite revolutionary. First, it brings the full power of SQL Server Analysis Services right into Excel. All of the speed and power of SSAS is available right on your desktop. Second, it uses a compression technology that allows vast amounts of data to be saved in a minimal amount of space. Millions of rows of data can now be stored, sorted, and aggregated in a reasonable amount of disk space with great speed. </p>
<p>PowerPivot can draw its data from a wide variety of sources. As you might expect, it can pull from almost any database. Additionally it can draw data from news feeds, SQL Server Reporting Services, other Excel sheets, it can even be typed in manually if need be. </p>
<p>Another issue that often faces the business analyst is the freshness of the data. The information is only as good as the date it was last imported into Excel. Traditionally “that guy” only got extracts of the database as IT had time, since it was often a time consuming process. PowerPivot addresses this through its <i>linked tables</i> feature. PowerPivot will remember where your data came from, and with one simple button click can refresh the spreadsheet with the latest information.</p>
<p>Because PowerPivot sits inside Microsoft Excel, it not only can create basic pivot tables but has all the full featured functionality of Excel at its disposal. It can format pivot tables in a wide array of styles, create pivot charts and graphs, and combine these together into useful dashboards. Additionally PowerPivot has a rich set of mathematical functionally, combining the existing functions already in Excel with an additional set of functions called Data Analysis eXpressions or DAX. </p>
<p><b>PowerPivot for SharePoint 2010</b></p>
<p>PowerPivot for Excel 2010 clearly solves several issues around the issue of analysis. It allows users to quickly create spreadsheets, pivot tables, charts, and more in a compact amount of space. If you recall though, creation was only half of “that guys” problem. The other half was sharing his analysis with the rest of his organization. That’s where PowerPivot for SharePoint 2010 comes into play.</p>
<p>Placing a PowerPivot Excel workbook in SharePoint 2010 not only enables traditional file sharing, but also activates several additional features. First, the spreadsheet is hosted right in the web browser. Thus users who might not have made the transition to Excel 2010 can still use the PowerPivot created workbook, slicing and filtering the data to get the information they require. </p>
<p>Data can also be refreshed on an automated, scheduled basis. This ensures the data is always up to date when doing analysis. Dashboards can also be created from the contents of a worksheet and displayed in SharePoint. Finally these PowerPivot created worksheets can be used as data sources for such tools as SQL Server Reporting Services. </p>
<p><b>Limitations</b></p>
<p>First, let me preface this by saying as of this writing all of the components are either in CTP (Community Technology Preview, a pre-beta) or Beta state. Thus there could be some changes between now and their final release next year. </p>
<p>To use the PowerPivot for Excel 2010 components, all you have to have is Excel 2010 and the PowerPivot add-in. If you want to share the workbook and get all the rich functionality SharePoint has to offer, you’ll have to have SharePoint 2010, running Excel Services and PowerPivot 2010 Services. You’ll also have to have SQL Server 2008 R2 Analysis Services running on the SharePoint 2010 box. Since you’ll have to have a SQL Server instance installed to support SharePoint this is not a huge limitation, especially since SSAS comes with SQL Server at no extra cost. </p>
<p>One thing I wish to make clear, SharePoint 2010 itself can run using any version of SQL Server from SQL Server 2005 on. It is the PowerPivot service that requires 2008 R2 Analysis Services. </p>
<p>One other important item to note: at some point the load upon the SharePoint 2010 server may grow too large if especially complex analysis is being done. Fortunately SharePoint 2010 ships with several tools that allow administrators to monitor the load and plan accordingly. At the point where the load is too big, it is a clear indication it’s time to transition from a PowerPivot solution to a full BI solution using a data warehouse and SQL Server Analysis Services. </p>
<p><b>What does PowerPivot mean for business users?</b></p>
<p>For business users, and especially “that guy”, it means complex analysis tools can be created in a short amount of time. Rich functionality makes it easier to spot trends and produce meaningful charts and graphs. It also means this information can be shared with others in the organization easily, without imposing large burdens on the corporate e-mail system or local file sharing mechanisms. </p>
<p>No longer will users be dependent on IT for their analysis, they will have the power to create everything they need on their own, truly bringing “self service BI” to fruition.</p>
<p><b>What does PowerPivot mean for Business Intelligence IT Pros?</b></p>
<p>The first reaction many BI developers have when hearing about PowerPivot is “oh no, this is going to put me out of a job!” Far from it, I firmly believe PowerPivot will create even more work for BI Professionals like myself. </p>
<p>As upper management grows to rely on the information provided by PowerPivot, they will also begin to understand the true value BI can bring to an organization. Selling a new BI solution into an organization where none currently exists can be difficult, as it can be hard to visualize how such a solution would work and the value it brings. PowerPivot allows BI functionality to be brought into an organization at a low development cost, proving the value of BI with minimal investment. Thus when there is a need to implement a larger, traditional BI project those same managers will be more forthcoming with the dollars.</p>
<p>Second, as users pull more and more data, they are going to want that data better organized than they will find in their current transactional business systems. This will in turn spur the need to create many new data warehouses. Likewise the IT department will also want data warehouses created, to reduce the load placed on those same transactional business systems. </p>
<p>I also foresee PowerPivot being used by BI Pros themselves to create solutions. The database structure of many transactional database systems can be difficult to understand even for experienced IT people, much less users. BI Pros can use PowerPivot to add a layer of abstraction between the database and the users, allowing business analysts to do their job without having to learn the complexity of a database system.</p>
<p>BI Pros can also use PowerPivot to implement quick turnaround solutions for customers, bringing more value for the customer’s dollar. When a BI Pro can prove him (or her) self by providing rich functionality in a short time frame it’s almost always the case they are brought back in for multiple engagements. </p>
<p>PowerPivot also provides great value to BI Pros who are employed full time in an enterprise organization. They can create solutions much quicker than before, freeing them up to do other valuable tasks. In addition PowerPivot solutions can provide a “stop gap” solution, pushing the date at which the organization needs to spend the dollars for a full blown BI solution and allowing IT to plan better. </p>
<p>Finally I see great value in PowerPivot as a prototyping tool for larger BI projects. Now users can see their data, interact with it, analyze it, and ensure the required measures and dimensions are present before proceeding with the larger project. </p>
<p>I’ll reiterate, if anything I believe PowerPivot will create an explosion of work for the Business Intelligence Professional.</p>
<p><b>Where can I learn more?</b></p>
<p>Well right here for one. I have become quite interested in PowerPivot since seeing it at the SQL PASS 2009 Summit. I think it will be a valuable tool for both myself and my customers. This will be the first of many blog posts to come on PowerPivot. I am also beginning a series of presentations on PowerPivot for local user groups and code camp events. The first will be Saturday, November 21<sup>st</sup> 2009 at the <a href="http://www.sharepointsaturday.org/birmingham/default.aspx">SharePoint Saturday in Birmingham Alabama</a>, but there will be many more to come. (If you’d like me to come speak at your group just shoot me an <a href="mailto:arcanecode@gmail.com?subject=PowerPivot%20Presentation">e-mail</a> and we’ll see what we can arrange.)</p>
<p>There’s also the PowerPivot site itself:</p>
<ul>
<li><a href="http://powerpivot.com/">http://powerpivot.com/</a></li>
</ul>
<p>I’ve also found a small handful of blogs on PowerPivot, listed in no particular order:</p>
<ul>
<li><a href="http://powerpivotpro.com/">http://powerpivotpro.com/</a></li>
<li><a href="http://powerpivotgeek.com/">http://powerpivotgeek.com/</a></li>
<li><a href="http://powerpivottwins.com/">http://powerpivottwins.com/</a></li>
<li><a href="http://powerpivot-info.com/">http://powerpivot-info.com/</a></li>
</ul>
<p><b>Summary</b></p>
<p>Thanks for sticking with me, I know this was a rather long blog post but PowerPivot has a lot of rich functionality to offer. While PowerPivot is still in the CTP/Beta stage as of this writing, I see more and more interest in the community, which will continue to grow as PowerPivot moves closer to release. I hope this post has set you off on the right step and you’ll continue to come back for more information. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1702/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1702&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/20/introducing-microsoft-powerpivot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/introex01_thumb.jpg" medium="image">
			<media:title type="html">IntroEx01</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/11/introex02_thumb.jpg" medium="image">
			<media:title type="html">IntroEx02</media:title>
		</media:content>
	</item>
		<item>
		<title>Populating a Kimball Date Dimension</title>
		<link>http://arcanecode.com/2009/11/18/populating-a-kimball-date-dimension/</link>
		<comments>http://arcanecode.com/2009/11/18/populating-a-kimball-date-dimension/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 02:37:54 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[Date Dimension]]></category>
		<category><![CDATA[Kimball]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/18/populating-a-kimball-date-dimension/</guid>
		<description><![CDATA[I’m a big fan of the Kimball method of Data Warehousing. A common task most of us setting up a new Data Warehouse face is creating a Date Dimension. In their book, “The Microsoft Data Warehouse Toolkit With SQL Server 2005 and the Microsoft Business Intelligence Toolset”, they have an example of a good date [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1697&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>I’m a big fan of the Kimball method of Data Warehousing. A common task most of us setting up a new Data Warehouse face is creating a Date Dimension. In their book, “<a href="http://www.amazon.com/Microsoft-Data-Warehouse-Toolkit-Microsoft-Business-Intelligence/dp/0471267155/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1258596124&amp;sr=8-1" target="_blank">The Microsoft Data Warehouse Toolkit With SQL Server 2005 and the Microsoft Business Intelligence Toolset</a>”, they have an example of a good date dimension table in their books <a href="http://kimballgroup.com/html/booksMDWTtools.html" target="_blank">sample code</a>. My complaint though was not so much with the layout itself, I liked it and found it fairly complete. Instead it was the method they chose to load it. They used an Excel spreadsheet, then a SQL Server Integration Services package to read the Excel file and load the date dimension table. </p>
<p>To me this approach has a couple of drawbacks. First, if you are doing all the loading on the server itself, you may not have Excel loaded. Thus you may be faced with the headache of creating the sheet then figuring out how to get it to a location the server can read. Second, when you go to add more dates in the future, you have to go into the spreadsheet and reset everything, removing what was there before. It can also be quite a headache to go back several years from know and find both SSIS packages and that Excel spreadsheet. Plus after that time changes may be made to both Excel and SSIS that make that solution no longer workable. Finally quite often it’s a DBA setting up the warehouse, and I’ve found there are still a few DBAs who are uncomfortable relying on SSIS, although I’m happy to say that number continues to shrink. </p>
<p>A T-SQL solution was clearly, to me anyway, the superior answer for both ease of use and long term stability. I assumed that as popular as the Kimball method is, someone would have already created a routine to load their style of date dimension, but some Binging and Googling around proved fruitless. I did find some code for loading some very simple date dimensions, but nothing as complete as the Kimball design. So, relishing a good coding challenge, I rolled up my sleeves and went to work. Below is the fruit of my labor, a script for loading a Kimball like date dimension. All you have to do is set the begin and end dates, indicate the offset for your fiscal year, and let ‘er rip. You can easily go back and add more dates by just adjusting the begin and end times. </p>
<p>A few things you should note. First, I did make a few slight modifications to the standard Kimball date dimension table as found in the previously mentioned book. They have a column titled “DateName” which holds the date as a string in YYYY/MM/DD format. As long as I was putting the date in, I decided to add string versions of the date for the US and Europe. These are in MM/DD/YYYY and DD/MM/YYYY formats and the columns are named “DateNameUS” and “DateNameEU” (for European Union) respectively. </p>
<p>Their table also had an audit key, used presumably by the SSIS package. I didn’t really see the need for an audit key for a date table, so I changed it to an identity column so I could have a secondary surrogate key if I needed it, just something to count the number of date rows easily and track the order they were inserted in. </p>
<p>One final, but very important distinction. I was in a post conference session taught by Erik Veerman at SQL PASS 2009. In it he mentioned using Dim and Fact schemas, thus you’d have [Dim].[Date] instead of [dbo].[DimDate]. I liked the idea as it was something I’d been considering myself, so in this version that is what I did. If you use the more traditional naming format of dbo.DimDate you’ll need to tweak the code. </p>
<p>Below is the code to load the Date Dimension table, which is my creation. Under it I placed my modified version of the Kimball Date Dimension table. It’s core code came from the sample code mentioned in the first paragraph then was modified by me. I include it for completeness. </p>
<p><strong><em>Code Sample 1 – Script to load a date dimension.</em></strong></p>
<pre class="code"><span style="color:green;">/*---------------------------------------------------------------------------*/
/* Loads a Date Dimension                                                    */
/*---------------------------------------------------------------------------*/

-- A few notes, this code does nothing to the existing table, no deletes
-- are triggered before hand. Because the DateKey is uniquely indexed,
-- it will simply produce errors if you attempt to insert duplicates.
-- You can however adjust the Begin/End dates and rerun to safely add
-- new dates to the table every year.
--
-- If the begin date is after the end date, no errors occur but nothing
-- happens as the while loop never executes.

</span><span style="color:blue;">SET NOCOUNT ON </span><span style="color:green;">-- turn off all the 1 row inserted messages

-- Hold our dates
</span><span style="color:blue;">DECLARE </span>@BeginDate <span style="color:blue;">DATETIME
DECLARE </span>@EndDate <span style="color:blue;">DATETIME

</span><span style="color:green;">-- Holds a flag so we can determine if the date is the last day of month
</span><span style="color:blue;">DECLARE </span>@LastDayOfMon <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>1<span style="color:gray;">)

</span><span style="color:green;">-- Number of months to add to the date to get the current Fiscal date
</span><span style="color:blue;">DECLARE </span>@FiscalYearMonthsOffset <span style="color:blue;">INT   

</span><span style="color:green;">-- These two counters are used in our loop.
</span><span style="color:blue;">DECLARE </span>@DateCounter <span style="color:blue;">DATETIME    </span><span style="color:green;">--Current date in loop
</span><span style="color:blue;">DECLARE </span>@FiscalCounter <span style="color:blue;">DATETIME  </span><span style="color:green;">--Fiscal Year Date in loop

-- Set the date to start populating and end populating
</span><span style="color:blue;">SET </span>@BeginDate <span style="color:gray;">= </span><span style="color:red;">'01/01/2008'
</span><span style="color:blue;">SET </span>@EndDate <span style="color:gray;">= </span><span style="color:red;">'12/31/2010' 

</span><span style="color:green;">-- Set this to the number of months to add to the current date to get
-- the beginning of the Fiscal year. For example, if the Fiscal year
-- begins July 1, put a 6 there.
-- Negative values are also allowed, thus if your 2010 Fiscal year
-- begins in July of 2009, put a -6.
</span><span style="color:blue;">SET </span>@FiscalYearMonthsOffset <span style="color:gray;">= </span>6

<span style="color:green;">-- Start the counter at the begin date
</span><span style="color:blue;">SET </span>@DateCounter <span style="color:gray;">= </span>@BeginDate

<span style="color:blue;">WHILE </span>@DateCounter <span style="color:gray;">&lt;= </span>@EndDate
      <span style="color:blue;">BEGIN
            </span><span style="color:green;">-- Calculate the current Fiscal date as an offset of
            -- the current date in the loop
            </span><span style="color:blue;">SET </span>@FiscalCounter <span style="color:gray;">= </span><span style="color:magenta;">DATEADD</span><span style="color:gray;">(</span>m<span style="color:gray;">, </span>@FiscalYearMonthsOffset<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">)

            </span><span style="color:green;">-- Set value for IsLastDayOfMonth
            </span><span style="color:blue;">IF </span><span style="color:magenta;">MONTH</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) = </span><span style="color:magenta;">MONTH</span><span style="color:gray;">(</span><span style="color:magenta;">DATEADD</span><span style="color:gray;">(</span>d<span style="color:gray;">, </span>1<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">))
               </span><span style="color:blue;">SET </span>@LastDayOfMon <span style="color:gray;">= </span><span style="color:red;">'N'
            </span><span style="color:blue;">ELSE
               SET </span>@LastDayOfMon <span style="color:gray;">= </span><span style="color:red;">'Y'  

            </span><span style="color:green;">-- add a record into the date dimension table for this date
            </span><span style="color:blue;">INSERT  INTO </span>[Dim]<span style="color:gray;">.</span>[Date]
                    <span style="color:gray;">(
                      </span>[DateKey]
                    <span style="color:gray;">, </span>[FullDate]
                    <span style="color:gray;">, </span>[DateName]
                    <span style="color:gray;">, </span>[DateNameUS]
                    <span style="color:gray;">, </span>[DateNameEU]
                    <span style="color:gray;">, </span>[DayOfWeek]
                    <span style="color:gray;">, </span>[DayNameOfWeek]
                    <span style="color:gray;">, </span>[DayOfMonth]
                    <span style="color:gray;">, </span>[DayOfYear]
                    <span style="color:gray;">, </span>[WeekdayWeekend]
                    <span style="color:gray;">, </span>[WeekOfYear]
                    <span style="color:gray;">, </span>[MonthName]
                    <span style="color:gray;">, </span>[MonthOfYear]
                    <span style="color:gray;">, </span>[IsLastDayOfMonth]
                    <span style="color:gray;">, </span>[CalendarQuarter]
                    <span style="color:gray;">, </span>[CalendarYear]
                    <span style="color:gray;">, </span>[CalendarYearMonth]
                    <span style="color:gray;">, </span>[CalendarYearQtr]
                    <span style="color:gray;">, </span>[FiscalMonthOfYear]
                    <span style="color:gray;">, </span>[FiscalQuarter]
                    <span style="color:gray;">, </span>[FiscalYear]
                    <span style="color:gray;">, </span>[FiscalYearMonth]
                    <span style="color:gray;">, </span>[FiscalYearQtr]
                    <span style="color:gray;">)
            </span><span style="color:blue;">VALUES  </span><span style="color:gray;">(
                      ( </span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) * </span>10000 <span style="color:gray;">) + ( </span><span style="color:magenta;">MONTH</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">)
                                                         * </span>100 <span style="color:gray;">)
                      + </span><span style="color:magenta;">DAY</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">)  </span><span style="color:green;">--DateKey
                    </span><span style="color:gray;">, </span>@DateCounter <span style="color:green;">-- FullDate
                    </span><span style="color:gray;">, </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">)) + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>dd<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) </span><span style="color:green;">--DateName
                    </span><span style="color:gray;">, RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>dd<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">)  + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">))</span><span style="color:green;">--DateName
                    </span><span style="color:gray;">, RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>dd<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">)  + </span><span style="color:red;">'/'
                      </span><span style="color:gray;">+ </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">))</span><span style="color:green;">--DateName
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>dw<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--DayOfWeek
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>dw<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--DayNameOfWeek
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>dd<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--DayOfMonth
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>dy<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--DayOfYear
                    </span><span style="color:gray;">, </span><span style="color:blue;">CASE </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>dw<span style="color:gray;">, </span><span style="color:red;">'11/16/2009'</span><span style="color:gray;">)
                        </span><span style="color:blue;">WHEN </span><span style="color:red;">'Saturday' </span><span style="color:blue;">THEN </span><span style="color:red;">'Weekend'
                        </span><span style="color:blue;">WHEN </span><span style="color:red;">'Sunday' </span><span style="color:blue;">THEN </span><span style="color:red;">'Weekend'
                        </span><span style="color:blue;">ELSE </span><span style="color:red;">'Weekday'
                      </span><span style="color:blue;">END </span><span style="color:green;">--WeekdayWeekend
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>ww<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--WeekOfYear
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--MonthName
                    </span><span style="color:gray;">, </span><span style="color:magenta;">MONTH</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--MonthOfYear
                    </span><span style="color:gray;">, </span>@LastDayOfMon <span style="color:green;">--IsLastDayOfMonth
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>qq<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--CalendarQuarter
                    </span><span style="color:gray;">, </span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--CalendarYear
                    </span><span style="color:gray;">, </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">)) + </span><span style="color:red;">'-'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) </span><span style="color:green;">--CalendarYearMonth
                    </span><span style="color:gray;">, </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@DateCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">)) + </span><span style="color:red;">'Q' </span><span style="color:gray;">+ </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>qq<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">) </span><span style="color:green;">--CalendarYearQtr
                    </span><span style="color:gray;">, </span><span style="color:magenta;">MONTH</span><span style="color:gray;">(</span>@FiscalCounter<span style="color:gray;">) </span><span style="color:green;">--[FiscalMonthOfYear]
                    </span><span style="color:gray;">, </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>qq<span style="color:gray;">, </span>@FiscalCounter<span style="color:gray;">) </span><span style="color:green;">--[FiscalQuarter]
                    </span><span style="color:gray;">, </span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@FiscalCounter<span style="color:gray;">) </span><span style="color:green;">--[FiscalYear]
                    </span><span style="color:gray;">, </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@FiscalCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">)) + </span><span style="color:red;">'-'
                      </span><span style="color:gray;">+ RIGHT(</span><span style="color:red;">'00' </span><span style="color:gray;">+ </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">DATEPART</span><span style="color:gray;">(</span>mm<span style="color:gray;">, </span>@FiscalCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>2<span style="color:gray;">))), </span>2<span style="color:gray;">) </span><span style="color:green;">--[FiscalYearMonth]
                    </span><span style="color:gray;">, </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@FiscalCounter<span style="color:gray;">) </span><span style="color:blue;">AS CHAR</span><span style="color:gray;">(</span>4<span style="color:gray;">)) + </span><span style="color:red;">'Q' </span><span style="color:gray;">+ </span><span style="color:magenta;">DATENAME</span><span style="color:gray;">(</span>qq<span style="color:gray;">, </span>@FiscalCounter<span style="color:gray;">) </span><span style="color:green;">--[FiscalYearQtr]
                    </span><span style="color:gray;">)

            </span><span style="color:green;">-- Increment the date counter for next pass thru the loop
            </span><span style="color:blue;">SET </span>@DateCounter <span style="color:gray;">= </span><span style="color:magenta;">DATEADD</span><span style="color:gray;">(</span>d<span style="color:gray;">, </span>1<span style="color:gray;">, </span>@DateCounter<span style="color:gray;">)
      </span><span style="color:blue;">END

SET NOCOUNT ON </span><span style="color:green;">-- turn the annoying messages back on

-- Select all rows inserted for the final year as a sanity check
</span><span style="color:blue;">SELECT  </span><span style="color:gray;">*
</span><span style="color:blue;">FROM    </span>[Dim]<span style="color:gray;">.</span>[Date]
<span style="color:blue;">WHERE </span>DateKey <span style="color:gray;">&gt; (</span><span style="color:magenta;">YEAR</span><span style="color:gray;">(</span>@EndDate<span style="color:gray;">) * </span>10000<span style="color:gray;">)
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>&#160;</p>
<p><strong><em>Code Sample 2 – Modified Kimball code to create a Date dimension.</em></strong></p>
<pre class="code"><span style="color:green;">/* Make sure the Dim schema exists */
</span><span style="color:blue;">IF </span><span style="color:magenta;">SCHEMA_ID</span><span style="color:gray;">(</span><span style="color:red;">'Dim'</span><span style="color:gray;">) IS NULL
   </span><span style="color:blue;">EXECUTE</span><span style="color:gray;">(</span><span style="color:red;">'CREATE SCHEMA [Dim] AUTHORIZATION [dbo]'</span><span style="color:gray;">)
</span>GO

<span style="color:green;">/* Drop table DimDate */
</span><span style="color:blue;">IF </span><span style="color:gray;">EXISTS ( </span><span style="color:blue;">SELECT  </span><span style="color:gray;">*
            </span><span style="color:blue;">FROM    </span>dbo<span style="color:gray;">.</span>sysobjects
            <span style="color:blue;">WHERE   </span>id <span style="color:gray;">= </span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">(</span>N<span style="color:red;">'[Dim].[Date]'</span><span style="color:gray;">)
                    AND </span><span style="color:magenta;">OBJECTPROPERTY</span><span style="color:gray;">(</span>id<span style="color:gray;">, </span>N<span style="color:red;">'IsUserTable'</span><span style="color:gray;">) = </span>1 <span style="color:gray;">)
   </span><span style="color:blue;">DROP TABLE </span>[Dim]<span style="color:gray;">.</span>[Date]
GO

<span style="color:green;">/* Create table DimDate */
</span><span style="color:blue;">CREATE TABLE </span>[Dim]<span style="color:gray;">.</span>[Date]
       <span style="color:gray;">( </span>[DateKey] <span style="color:blue;">BIGINT </span><span style="color:gray;">NOT NULL
       , </span>[FullDate] <span style="color:blue;">DATETIME </span><span style="color:gray;">NULL
       , </span>[DateName] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>11<span style="color:gray;">) NULL
       , </span>[DateNameUS] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>11<span style="color:gray;">) NULL   </span><span style="color:green;">--US Date FORMAT, MM/DD/YYYY
       </span><span style="color:gray;">, </span>[DateNameEU] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>11<span style="color:gray;">) NULL   </span><span style="color:green;">--European Union Date Format DD/MM/YYYY
       </span><span style="color:gray;">, </span>[DayOfWeek] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[DayNameOfWeek] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>10<span style="color:gray;">) NULL
       , </span>[DayOfMonth] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[DayOfYear] <span style="color:blue;">SMALLINT </span><span style="color:gray;">NULL
       , </span>[WeekdayWeekend] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>7<span style="color:gray;">) NULL
       , </span>[WeekOfYear] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[MonthName] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>10<span style="color:gray;">) NULL
       , </span>[MonthOfYear] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[IsLastDayOfMonth] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>1<span style="color:gray;">) NULL
       , </span>[CalendarQuarter] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[CalendarYear] <span style="color:blue;">SMALLINT </span><span style="color:gray;">NULL
       , </span>[CalendarYearMonth] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>7<span style="color:gray;">) NULL
       , </span>[CalendarYearQtr] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>7<span style="color:gray;">) NULL
       , </span>[FiscalMonthOfYear] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[FiscalQuarter] <span style="color:blue;">TINYINT </span><span style="color:gray;">NULL
       , </span>[FiscalYear] <span style="color:blue;">INT </span><span style="color:gray;">NULL
       , </span>[FiscalYearMonth] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>9<span style="color:gray;">) NULL
       , </span>[FiscalYearQtr] <span style="color:blue;">CHAR</span><span style="color:gray;">(</span>8<span style="color:gray;">) NULL
       , </span>[AuditKey] <span style="color:blue;">BIGINT IDENTITY </span><span style="color:gray;">NOT NULL
       , </span><span style="color:blue;">CONSTRAINT </span>[PK_DimDate] <span style="color:blue;">PRIMARY KEY CLUSTERED </span><span style="color:gray;">( </span>[DateKey] <span style="color:gray;">)
       )
</span><span style="color:blue;">ON     </span>[PRIMARY]
GO

<span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Table Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Dimension'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'View Name'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Date dimension contains one row for every day, beginning at 1/1/2000. There may also be rows for &quot;hasn''t happened yet.&quot;'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Used in schemas'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Sales (3 roles); Finance; Currency Rates; Sales Quota (2 roles; one at Cal Qtr level)'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'

</span>GO

<span style="color:blue;">INSERT  INTO </span>[Dim]<span style="color:gray;">.</span>[Date]
        <span style="color:gray;">( </span>DateKey
        <span style="color:gray;">, </span>FullDate
        <span style="color:gray;">, </span>[DateName]
        <span style="color:gray;">, </span>[DateNameUS]
        <span style="color:gray;">, </span>[DateNameEU]
        <span style="color:gray;">, </span>[DayOfWeek]
        <span style="color:gray;">, </span>DayNameOfWeek
        <span style="color:gray;">, </span>[DayOfMonth]
        <span style="color:gray;">, </span>[DayOfYear]
        <span style="color:gray;">, </span>WeekdayWeekend
        <span style="color:gray;">, </span>WeekOfYear
        <span style="color:gray;">, </span>[MonthName]
        <span style="color:gray;">, </span>MonthOfYear
        <span style="color:gray;">, </span>IsLastDayOfMonth
        <span style="color:gray;">, </span>CalendarQuarter
        <span style="color:gray;">, </span>CalendarYear
        <span style="color:gray;">, </span>CalendarYearMonth
        <span style="color:gray;">, </span>CalendarYearQtr
        <span style="color:gray;">, </span>FiscalMonthOfYear
        <span style="color:gray;">, </span>FiscalQuarter
        <span style="color:gray;">, </span>FiscalYear
        <span style="color:gray;">, </span>FiscalYearMonth
        <span style="color:gray;">, </span>FiscalYearQtr
        <span style="color:gray;">)
</span><span style="color:blue;">VALUES  </span><span style="color:gray;">( -</span>1
        <span style="color:gray;">, NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, NULL
        , NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, NULL
        , </span><span style="color:red;">'N'
        </span><span style="color:gray;">, NULL
        , NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, NULL
        , NULL
        , NULL
        , </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">, </span><span style="color:red;">'Unknown'
        </span><span style="color:gray;">)
</span>GO

<span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Surrogate primary key'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Full date as a SQL date (time=00:00:00)'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FullDate' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Standard Date Format of YYYY/MM/DD'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Standard US Date Format of MM/DD/YYYY'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateNameUS' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Standard European Union Date Format of DD/MM/YYYY'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateNameEU' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Number of the day of week; Sunday = 1'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Day name of week'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayNameOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Number of the day in the month'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Number of the day in the year'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Is today a weekday or a weekend'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekdayWeekend' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Week of year'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Month name'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Month of year'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Is this the last day of the calendar month?'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'IsLastDayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Calendar quarter'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Calendar year'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Calendar year and month'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Calendar year and quarter'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Fiscal month of year (1..12). FY starts in July'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalMonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Fiscal quarter'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Fiscal year. Fiscal year begins in July.'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Fiscal year and month'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Fiscal year and quarter'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Description'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'What process loaded this row?'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'AuditKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'FK To'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'DimAudit.AuditKey'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'AuditKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'20041123'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'11/23/2004'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FullDate' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'23-Nov-2004'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1..7'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Sunday'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayNameOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1..31'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1..365'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Weekday, Weekend'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekdayWeekend' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1..52 or 53'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'November'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1, 2, …, 12'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Y, N'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'IsLastDayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1, 2, 3, 4'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'2004'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'2004-01'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'2004Q1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1, 2, …, 12'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalMonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1, 2, 3, 4'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'2004'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'FY2004-01'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Example Values'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'FY2004Q1'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayNameOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekdayWeekend' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'IsLastDayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalMonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'SCD  Type'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'1'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FullDate' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayNameOfWeek' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DayOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekdayWeekend' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'WeekOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthName' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'MonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'IsLastDayOfMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'CalendarYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalMonthOfYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalQuarter' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYear' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearMonth' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">, </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived'</span><span style="color:gray;">,
  </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">,
  </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'FiscalYearQtr' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Source System'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'Derived in ETL'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">, </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">,
  </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">, </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">,
  </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'AuditKey' </span><span style="color:gray;">;
</span><span style="color:blue;">EXEC </span>sys.sp_addextendedproperty @name <span style="color:gray;">= </span>N<span style="color:red;">'Comments'</span><span style="color:gray;">,
  </span>@value <span style="color:gray;">= </span>N<span style="color:red;">'In the form: yyyymmdd'</span><span style="color:gray;">, </span>@level0type <span style="color:gray;">= </span>N<span style="color:red;">'SCHEMA'</span><span style="color:gray;">,
  </span>@level0name <span style="color:gray;">= </span>N<span style="color:red;">'Dim'</span><span style="color:gray;">, </span>@level1type <span style="color:gray;">= </span>N<span style="color:red;">'TABLE'</span><span style="color:gray;">, </span>@level1name <span style="color:gray;">= </span>N<span style="color:red;">'Date'</span><span style="color:gray;">,
  </span>@level2type <span style="color:gray;">= </span>N<span style="color:red;">'COLUMN'</span><span style="color:gray;">, </span>@level2name <span style="color:gray;">= </span>N<span style="color:red;">'DateKey' </span><span style="color:gray;">;
</span>GO</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1697/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1697&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/18/populating-a-kimball-date-dimension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL PASS Summit 2009 &#8211; Birds of a Feather Lunch</title>
		<link>http://arcanecode.com/2009/11/03/sql-pass-summit-2009-birds-of-a-feather-lunch/</link>
		<comments>http://arcanecode.com/2009/11/03/sql-pass-summit-2009-birds-of-a-feather-lunch/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:26:30 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/11/03/sql-pass-summit-2009-birds-of-a-feather-lunch/</guid>
		<description><![CDATA[I’m currently at the SQL PASS Summit in Seattle Washington. At today’s Birds of a Feather lunch I’ll be acting as host for a table. Our subject is Full Text Searching and FileStreaming. If you’d like to learn more about either of these topics come on by, would love to meet you and see more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1696&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>I’m currently at the SQL PASS Summit in Seattle Washington. At today’s Birds of a Feather lunch I’ll be acting as host for a table. Our subject is Full Text Searching and FileStreaming. If you’d like to learn more about either of these topics come on by, would love to meet you and see more of how you use these products in your environment. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1696/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1696&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/11/03/sql-pass-summit-2009-birds-of-a-feather-lunch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>TechMixer University &#8211; SSIS for Developers</title>
		<link>http://arcanecode.com/2009/10/13/techmixer-university-ssis-for-developers/</link>
		<comments>http://arcanecode.com/2009/10/13/techmixer-university-ssis-for-developers/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 14:38:06 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/10/13/techmixer-university-ssis-for-developers/</guid>
		<description><![CDATA[In addition to help recruit speakers, I also had the privilege of speaking at TechMixer University 2009. 
The slide deck and main demo can be found at my Code Gallery site:
https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&#38;ReleaseId=2883
The calling of SSIS from .Net demo can be found at:
http://code.msdn.microsoft.com/ssisfromnet
Thanks to everyone who attended TechMixer University. I look forward to seeing you next year!
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1695&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>In addition to help recruit speakers, I also had the privilege of speaking at TechMixer University 2009. </p>
<p>The slide deck and main demo can be found at my Code Gallery site:</p>
<p><a title="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&amp;ReleaseId=2883" href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&amp;ReleaseId=2883" target="_blank">https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=SSISForDevs&amp;ReleaseId=2883</a></p>
<p>The calling of SSIS from .Net demo can be found at:</p>
<p><a title="http://code.msdn.microsoft.com/ssisfromnet" href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">http://code.msdn.microsoft.com/ssisfromnet</a></p>
<p>Thanks to everyone who attended TechMixer University. I look forward to seeing you next year!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1695&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/10/13/techmixer-university-ssis-for-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Saturday 25 Gainesville GA &#8211; October 10 2009</title>
		<link>http://arcanecode.com/2009/10/10/sql-saturday-25-gainesville-ga-october-10-2009/</link>
		<comments>http://arcanecode.com/2009/10/10/sql-saturday-25-gainesville-ga-october-10-2009/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:32:17 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Full Text Searching]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://arcanecode.com/?p=1691</guid>
		<description><![CDATA[




SQL Saturday 25 occurred in the lovely town of Gainesville GA on October 10th. At the event I did two presentations.
My first presentation of the day was Introduction to SQL Server Integration Services. The sample project, slide deck, and step by step instructions can be found at http://code.msdn.microsoft.com/introssis . In addition I also showed how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1691&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><div class="mceTemp">
<dl class="wp-caption alignright">
<dt class="wp-caption-dt"><a href="http://arcanecode.files.wordpress.com/2009/10/sqlsat25.jpg"><img class="size-full wp-image-1693" title="sqlsat25" src="http://arcanecode.files.wordpress.com/2009/10/sqlsat25.jpg?w=240&#038;h=98" alt="SQL Saturday 25 Logo" width="240" height="98" /></a></dt>
</dl>
</div>
<p>SQL Saturday 25 occurred in the lovely town of Gainesville GA on October 10th. At the event I did two presentations.</p>
<p>My first presentation of the day was Introduction to SQL Server Integration Services. The sample project, slide deck, and step by step instructions can be found at <a title="http://code.msdn.microsoft.com/introssis" href="http://code.msdn.microsoft.com/introssis" target="_blank">http://code.msdn.microsoft.com/introssis</a> . In addition I also showed how to call SSIS from a .Net application. You can find that sample at <a title="http://code.msdn.microsoft.com/ssisfromnet" href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">http://code.msdn.microsoft.com/ssisfromnet</a></p>
<p>The second presentation is SQL Server Full Text Searching. You can find the slide deck in PDF format as well as sample code at <a title="http://code.msdn.microsoft.com/SqlServerFTS" href="http://code.msdn.microsoft.com/SqlServerFTS" target="_blank">http://code.msdn.microsoft.com/SqlServerFTS</a>.</p>
<p>Thanks to <a href="http://codegumbo.com/" target="_blank">Stu </a>and the crew for a great event!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1691/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1691&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/10/10/sql-saturday-25-gainesville-ga-october-10-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/10/sqlsat25.jpg" medium="image">
			<media:title type="html">sqlsat25</media:title>
		</media:content>
	</item>
		<item>
		<title>Using SSIS Package Configuration Values as Parameters to SQL Tasks</title>
		<link>http://arcanecode.com/2009/10/06/using-ssis-package-configuration-values-as-parameters-to-sql-tasks/</link>
		<comments>http://arcanecode.com/2009/10/06/using-ssis-package-configuration-values-as-parameters-to-sql-tasks/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 03:59:28 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/10/06/using-ssis-package-configuration-values-as-parameters-to-sql-tasks/</guid>
		<description><![CDATA[Last weekend I presented at SQL Saturday in Redmond WA. One attendee asked if it was possible to use values from the Package configuration file as parameters to a SQL Task. The answer was a definite yes, although I didn’t have a good example. This post aims to fix that. 
Let’s start with the basic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1690&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Last weekend I presented at SQL Saturday in Redmond WA. One attendee asked if it was possible to use values from the Package configuration file as parameters to a SQL Task. The answer was a definite yes, although I didn’t have a good example. This post aims to fix that. </p>
<p>Let’s start with the basic workflow. First you will need to create a variable, this variable will be used to pass the value from the config file to the SQL statement. Next you will need to establish a package configuration file, to hold the configured value. After that you will create an Execute SQL Task. In the input statement for the task, simply use ? for each parameter in the T-SQL statement. Finally you’ll click on the Parameter Mapping area of the SQL Task and map the variable to the position of each ?. </p>
<p>Now that you have a basic overview of where we’re going, let’s start this example by creating a simple table to update. Pick your favorite database, or create a test one, then run a simple script to create a table. I used my ArcaneCode database, which I use for samples, and created a table named TestParamToProcs in the dbo schema. </p>
<p><font face="Courier New">USE [ArcaneCode]     <br />GO </font></p>
<p><font face="Courier New">/****** Object:&#160; Table [dbo].[TestParamToProcs]&#160;&#160;&#160; Script Date: 10/06/2009 21:45:19 ******/     <br />SET ANSI_NULLS ON      <br />GO </font></p>
<p><font face="Courier New">SET QUOTED_IDENTIFIER ON     <br />GO </font></p>
<p><font face="Courier New">CREATE TABLE [dbo].[TestParamToProcs](     <br />&#160;&#160;&#160; [ID] [int] IDENTITY(1,1) NOT NULL,      <br />&#160;&#160;&#160; [SomeText] [nvarchar](50) NULL,      <br /> CONSTRAINT [PK_TestParamToProcs] PRIMARY KEY CLUSTERED       <br />(      <br />&#160;&#160;&#160; [ID] ASC      <br />)WITH (PAD_INDEX&#160; = OFF, STATISTICS_NORECOMPUTE&#160; = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS&#160; = ON, ALLOW_PAGE_LOCKS&#160; = ON) ON [PRIMARY]      <br />) ON [PRIMARY] </font></p>
<p><font face="Courier New">GO </font></p>
<p>Now let’s create a new package. I started by opening BIDS (Business Intelligence Developer Studio), creating a solution and named it ConfigFileToSqlParams. I added a Shared Data Source to connect to my database. Next I renamed the default package to ParamToProcs.dtsx. I added the shared data source to the connection managers area of the package. </p>
<p>OK, that takes care of the basics. Next we need to setup the package for variables and a config file. Open up the variables window (click in the Control Surface area, and in the SSIS menu pick Variables.) Create a new variable, we’ll call it MyParam. Make it a string and insert the value of “X” into it. </p>
<p>Now right click on the Control Flow surface (all that yellow area in the Control Flow tab) and pick Package Configurations. Click the check box to “Enable package configurations”, then click the Add button at the bottom of the screen. You are now presented with the Package Configuration Wizard. The first screen is just a welcome screen, you can click past it. The next screen is the “Select Configuration Type” screen. Make sure the default of “XML configuration file” is selected in the drop down. Next under “Specify configuration files directly” enter the path and file name for your config XML file. I named mine ParamToProcsConfig.xml and clicked Next. </p>
<p>The next step in the wizard is the “Select Properties to Export” screen. Expand the Variables area in the tree, then the tree for MyParam, then Properties. Now make sure the only box checked is the one for “Value”. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/10/1_propstoexport.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="1_PropsToExport" border="0" alt="1_PropsToExport" src="http://arcanecode.files.wordpress.com/2009/10/1_propstoexport_thumb.jpg?w=529&#038;h=484" width="529" height="484" /></a> </p>
<p>Click Next once your screen looks like the one above, and you’ll be at the completion screen. Give your package config a good name, I used MyParamConfig, and clicked Finish.</p>
<p>Now let’s drop 3 SQL Tasks into the Control Flow surface. The first task will simply delete all the rows in the table that was just created. That way we can run the package repeatedly. For all three tasks set the Connection to the shared source you added in the Connection Managers area. Now for the SQLStatement of our first task, we’ll use Direct Input and enter this SQL statement:</p>
<p><font size="2" face="Courier New">DELETE FROM dbo.TestParamToProcs</font></p>
<p>For the next SQL task we’ll insert a row into our table to manipulate. Use this for the SQL Statement property.</p>
<p><font face="Courier New">INSERT INTO dbo.TestParamToProcs (SomeText) VALUES (&#8216;Hello&#8217;)</font></p>
<p>OK, those were fairly easy and straight forward. Now comes the fun part. For the next SQL Task, we’ll use this statement for the SQLStatement property. </p>
<p><font face="Courier New">UPDATE dbo.TestParamToProcs SET SomeText = ?</font></p>
<p>Note the use of the ? (question mark) for the value of the SomeText field. This is the parameter. Now we need to supply a value to this parameter. Over on the left, click the Parameter Mapping tab. Click Add and a new row will be placed in the grid. In the first column, Variable Name, from the drop down pick “User::MyParam”. Leave the Direction as “Input”. Since this is a string variable, we’ll need to change the Data Type column to “VARCHAR”. Finally we need to set the Parameter Name, For this we’ll enter a 0 (zero). We’ll leave the Parameter Size at the default of –1.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/10/2_params.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2_Params" border="0" alt="2_Params" src="http://arcanecode.files.wordpress.com/2009/10/2_params_thumb.jpg?w=593&#038;h=484" width="593" height="484" /></a> </p>
<p>When your dialog resembles this one, you can click OK. If you needed to use more than one parameter, just use ? for each place where a parameter would go in your T-SQL statement. Then use the values of 0, 1, 2 etc for the Parameter Name. 0 will map to the first ?, 1 to the second, and so on. OK at this point your SSIS package should look something like:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/10/3_package.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="3_Package" border="0" alt="3_Package" src="http://arcanecode.files.wordpress.com/2009/10/3_package_thumb.jpg?w=301&#038;h=249" width="301" height="249" /></a> </p>
<p>If you now run the package, then jump into SQL Server Management Studio and run a “<font face="Courier New">SELECT * FROM dbo.TestParamToProcs</font>”, you should see one row with the SomeText column set to X. Great! Now lets give it one more test. We should change the config file, and run the package outside of BIDS. </p>
<p>First, open notepad or some other text editor, then open up the ParamToProcsConfig.XML file. Move to the &lt;ConfiguredValue&gt; tags, and change the X to something else. I used “ArcaneCode” as it was rather spiffy, but you can use your name, or your cat’s name if you like. Save the file and you can close your text editor. </p>
<p>Now let’s use dtexec to run our package. Open up a command window and navigate to the folder where your package is located. I then used the dtexecui utility to create a package execution command. I’d encourage you to play with this, but so we’re all on the same page here is the dtexec command line I came up with:</p>
<p><font face="Courier New">dtexec /FILE &quot;D:\Presentations\SQL Server\ConfigFileToSqlParams\ConfigFileToSqlParams\ConfigFileToSqlParams\ParamToProcs.dtsx&quot; /CHECKPOINTING OFF&#160; /REPORTING EW </font></p>
<p>Of course you’ll want to change the path to wherever you have the ParamToProcs.dtsx package. You should be able to run the above command line and execute your package. If you the jump back to SSMS and rerun the “<font face="Courier New">SELECT * FROM dbo.TestParamToProcs</font>”, you should now see the row with the new value from the config file. </p>
<p>To summarize, the basic steps are:</p>
<p>1. Create the variable</p>
<p>2. Store the variable in a package configuration XML file.</p>
<p>3. Create a SQL Task. Use ? for the parameters in the T-SQL statement.</p>
<p>4. Map the variables to the parameters.</p>
<p>5. Run. Be happy. </p>
<p>And that’s all there is to it. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1690/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1690&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/10/06/using-ssis-package-configuration-values-as-parameters-to-sql-tasks/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/10/1_propstoexport_thumb.jpg" medium="image">
			<media:title type="html">1_PropsToExport</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/10/2_params_thumb.jpg" medium="image">
			<media:title type="html">2_Params</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/10/3_package_thumb.jpg" medium="image">
			<media:title type="html">3_Package</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Saturday Redmond &#8211; October 3 2009</title>
		<link>http://arcanecode.com/2009/10/03/sql-saturday-redmond-october-3-2009/</link>
		<comments>http://arcanecode.com/2009/10/03/sql-saturday-redmond-october-3-2009/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 12:11:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[FTS]]></category>
		<category><![CDATA[SQL Saturday]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/10/03/sql-saturday-redmond-october-3-2009/</guid>
		<description><![CDATA[I am fortunate enough to be able to give three presentations at Redmond WA’s SQL Saturday event. The first session is “Introduciton to Data Warehousing / Business Intelligence”. Here is the PDF slide deck for that presentation. (Right click and save as if you want to save a copy for later reference). 
The second presentation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1683&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>I am fortunate enough to be able to give three presentations at Redmond WA’s SQL Saturday event. The first session is “Introduciton to Data Warehousing / Business Intelligence”. <a href="http://arcanecode.files.wordpress.com/2009/10/introtodatawarehousing1.pdf" target="_blank">Here is the PDF slide deck</a> for that presentation. (Right click and save as if you want to save a copy for later reference). </p>
<p>The second presentation is SQL Server Full Text Searching. You can find the slide deck in PDF format as well as sample code at <a title="http://code.msdn.microsoft.com/SqlServerFTS" href="http://code.msdn.microsoft.com/SqlServerFTS" target="_blank">http://code.msdn.microsoft.com/SqlServerFTS</a>. </p>
<p>The final presentation of the day was Introduction to SQL Server Integration Services. The sample project, slide deck, and step by step instructions can be found at <a title="http://code.msdn.microsoft.com/introssis" href="http://code.msdn.microsoft.com/introssis" target="_blank">http://code.msdn.microsoft.com/introssis</a> . In addition I also showed how to call SSIS from a .Net application. You can find that sample at <a title="http://code.msdn.microsoft.com/ssisfromnet" href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">http://code.msdn.microsoft.com/ssisfromnet</a> . </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1683/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1683/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1683/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1683/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1683/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1683&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/10/03/sql-saturday-redmond-october-3-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server MVPs Help War Child International</title>
		<link>http://arcanecode.com/2009/09/29/sql-server-mvps-help-war-child-international/</link>
		<comments>http://arcanecode.com/2009/09/29/sql-server-mvps-help-war-child-international/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 04:52:22 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/09/29/sql-server-mvps-help-war-child-international/</guid>
		<description><![CDATA[I’m proud to announce the new book SQL Server MVP Deep Dives has been released. You can find out more, as well as place your pre-order for the book at http://www.sqlservermvpdeepdives.com 
I am proud for several reasons. First, I am a contributing author. If you look at Chapter 13, Full Text Searching, you’ll find my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1680&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p><a href="http://arcanecode.files.wordpress.com/2009/09/sqlservermvpdeepdiverscover.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;margin:0 10px 0 0;" title="SQL Server MVP Deep Divers Cover" border="0" alt="SQL Server MVP Deep Divers Cover" align="left" src="http://arcanecode.files.wordpress.com/2009/09/sqlservermvpdeepdiverscover_thumb.jpg?w=192&#038;h=240" width="192" height="240" /></a>I’m proud to announce the new book SQL Server MVP Deep Dives has been released. You can find out more, as well as place your pre-order for the book at <a href="http://www.sqlservermvpdeepdives.com">http://www.sqlservermvpdeepdives.com</a> </p>
<p>I am proud for several reasons. First, I am a contributing author. If you look at Chapter 13, Full Text Searching, you’ll find my name, Robert C. Cain. This is my first work in print, and it was a great experience. I got a lot of great advice from the editors, fellow MVPs. It was also good as I got to do some editing myself. (To keep down costs we edited each others chapters.) In addition I got to work with the great folks at Manning and working through their publication process. </p>
<p>But I’m even more proud because all proceeds from the book go to <a href="http://www.warchild.org" target="_blank">War Child International</a>. War Child International is a federation of charities devoted to helping children in war torn countries. They not only meet the basic needs of the kids, but work to give a message of peace, so when they grow up the cycle of violence will be broken. </p>
<p>The official book launch will take place at the <a href="http://summit2009.sqlpass.org/AboutSummit/ROI/tabid/63/Default.aspx" target="_blank">PASS Summit</a>, Nov. 2 to 5 in Seattle Washington. Manning promises to have plenty of the books in the Summit bookstore. Many of the MVPs, including myself, will be there and be glad to sign books for those interested. </p>
<p>To make the most of your donation though, placing your order at <a href="http://www.sqlservermvpdeepdives.com">http://www.sqlservermvpdeepdives.com</a> will get the most money to War Child. If you order now, you can access the early online version, and a printed copy will be mailed to you. This is a great chance to gain a tremendous amount of knowledge and help a worthy cause at the same time. Plus there is an added bonus for those attending the PASS Summit, if you buy now you can read chapters on line, and be prepared to ask questions of the authors at the summit!</p>
<p>&#160;</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/wc_wallpaper23_800x600.jpg"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="wc_wallpaper23_800x600" border="0" alt="wc_wallpaper23_800x600" src="http://arcanecode.files.wordpress.com/2009/09/wc_wallpaper23_800x600_thumb.jpg?w=644&#038;h=484" width="644" height="484" /></a></p>
<p>&#160;</p>
<p>How can you help?&#160; Obviously, start by buying a copy of the book. Then let your fellow SQL Server and Developer geeks know about this effort. Urge them to buy a copy, get your company to buy several for the company library. Or do like I will, and buy several copies to give to friends. Finally, you can take the direct approach. Go directly to the <a href="http://www.warchild.org" target="_blank">War Child site</a> and make a donation today. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1680/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1680/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1680/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1680&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/09/29/sql-server-mvps-help-war-child-international/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/sqlservermvpdeepdiverscover_thumb.jpg" medium="image">
			<media:title type="html">SQL Server MVP Deep Divers Cover</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/wc_wallpaper23_800x600_thumb.jpg" medium="image">
			<media:title type="html">wc_wallpaper23_800x600</media:title>
		</media:content>
	</item>
		<item>
		<title>WordCamp Birmingham 2009 &#8211; Freedom of Speech</title>
		<link>http://arcanecode.com/2009/09/28/wordcamp-birmingham-2009-freedom-of-speech/</link>
		<comments>http://arcanecode.com/2009/09/28/wordcamp-birmingham-2009-freedom-of-speech/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 06:01:00 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[User Groups]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/09/28/wordcamp-birmingham-2009-freedom-of-speech/</guid>
		<description><![CDATA[Over the weekend I attended WordCamp Birmingham 2009. For those of you who don’t know, WordCamp is a code camp for WordPress users and developers. WordPress is a very popular open source blogging engine. Users can download the WordPress engine from http://wordpress.org/, then customize it to their needs.
WordPress can do some pretty amazing things, many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1672&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Over the weekend I attended WordCamp Birmingham 2009. For those of you who don’t know, WordCamp is a code camp for WordPress users and developers. WordPress is a very popular open source blogging engine. Users can download the WordPress engine from <a title="http://wordpress.org/" href="http://wordpress.org/" target="_blank">http://wordpress.org/</a>, then customize it to their needs.</p>
<p>WordPress can do some pretty amazing things, many of the developers there specialize in customizing WordPress to individual corporate needs, and transforming WordPress to a full Content Management System (CMS).</p>
<p>In addition to being an open source engine, it’s sister sight, <a href="http://wordpress.com" target="_blank">http://wordpress.com</a>, is a hosting site. Through it you can create your own blog, for free. You can customize your blog from a variety of base templates, then add further custom tweaks through the various widgets and plug-ins offered by the WordPress.com folks. For minimal fees you can add a custom domain name, and extend the amount of space you have available.</p>
<p>That’s what I’ve done with this blog. Arcane Code is hosted on WordPress.com, and I pay the small fee (about 15 dollars US per year) to have the <a href="http://arcanecode.com" target="_blank">http://arcanecode.com</a> URL. You may ask “gee Robert, you’re a smart guy, why let them host and not get the software from the .org site and host yourself?” You’re right, I am a smart guy! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Seriously, I could host the engine myself, but to be honest I would rather spend my time writing blog posts than worrying about upgrading my blog software to the current version. I let the nice folks at wordpress.com take care of those headaches for me.</p>
<p>Of course there are a few restrictions with the .com site that I would not have with the .org software and self hosting. The biggest is no advertising, I can’t sell ads on the blog while it’s on the .com site. I’m also limited on templates and customizations, I have to use the built in .com templates, with the .org software the sky is the limit to what I want to do. For not having to deal with the headaches of managing my blog engine though, these are trade off’s I’m willing to make. One day in the future I may change my mind, but for now I’m quite happy.</p>
<p>But enough about the blogging software, let’s talk about WordCamp. For my .Net developer buddies or fellow SQL geeks, WordCamp is just like any code camp or <a href="http://sqlsaturday.com/" target="_blank">SQL Saturday</a> you’ve been to. Speakers are organized into one or more tracks. Most of the speakers are from the local community or surrounding region, with a few big wigs thrown in for good measure.</p>
<p>This year <a href="http://www.innovationdepot.net/" target="_blank">Innovation Depot</a> hosted the Saturday tracks, one for developers and the other for bloggers. The blogger track was aimed at new users or folks who simply wanted to work with social media, and leave the technical considerations to others. The developer track was for the geeks who liked to customize and develop widgets and plug ins for use with WordPress. Lunch was some great BBQ, fitting for a true southern event.</p>
<p>The Sunday event took place at <a href="http://shiftworkspace.com/" target="_blank">Shift Workspace</a>, which is a facility where you can rent space to work in for under $50 US a month. Tables, comfortable chairs, coffee and soda, and all the wi-fi you can eat. It’s a nice place, and the format was very open. On the first floor small groups gathered to discuss and debate topics around the software. The second floor was the experts area, I saw many groups of two huddled around laptops, getting and giving advice on particular issues folks were having.</p>
<p>The highlight of the event was <a href="http://ma.tt" target="_blank">Matt Mullenweg’s</a> lunchtime keynote on Saturday. Matt is the original creator of WordPress, it was his idea and his guidance that made it successful. In addition Matt also founded a company to host WordPress.com and provide extra services for advanced users. In addition to being a good businessman Matt is also a great speaker, his lunch time presentation was both informative and humorous.</p>
<p>Also in attendance was <a href="http://dougal.gunters.org/" target="_blank">Dougal Campbell</a>. Dougal was one of the original group of developers of WordPress. He and Matt have been working together on the open source software since 2003. Oddly enough this event was something of a historic occasion for them, even though they have been e-mailing and phone calling with each other since 2003, this weekend was the first time Matt and Dougal had actually met face to face! In the interest of full disclosure I should add that Dougal is my brother-in-law, he is married to my kid sister. But I won’t hold that against him.</p>
<p>The closing keynote on Saturday was from an <span style="text-decoration:line-through;">Iranian</span> Bahrainian blogger. In the interest of protecting their security I won’t say too much, but it was a very moving presentation that reminded us all of <strong>how great a privilege freedom of speech is</strong>. One Iranian blogger <a href="http://www.march18.org/" target="_blank">has already died in jail</a>, and another Egyptian blogger <a href="http://www.freekareem.org/" target="_blank">is currently in jail right now</a> for doing nothing more than speaking his opinions through his blog. </p>
<p>I have to give the organizers high marks, the event was run well, lunch arrived on time, and plenty of it. There was a big crowd, I heard about 165 registered, and I think just about every one of them made it from the crowds I saw. We had such a good response the organizers even spoke about the possibility of creating a WordPress user group of sorts, and having smaller events either on a monthly or quarterly basis.</p>
<p>This was a really fun event. I saw some friends (and relatives if you count Dougal) and met a lot of new people. I talked to folks from Nashville TN, Charlotte NC, Atlanta GA, and one lady from New Jersey. I also heard about one person coming in from Arkansas and another from Texas. I also came away with some great ideas around social networking, and using various forms of multimedia to enhance information and knowledge transfer in the work place. I spoke to a lawyer who specializes in discovery and got into an interesting discussion about data mining of unstructured data. I also have an idea that might be relevant for a presentation next year. Finally I am struck with the notion of taking WordPress and making it a dashboard for a SQL Server Business Intelligence solution. Hmmm…..</p>
<p>All in all it was a great WordCamp, and I’m looking forward to the 2010 event.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1672/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1672&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/09/28/wordcamp-birmingham-2009-freedom-of-speech/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling SSIS from .Net</title>
		<link>http://arcanecode.com/2009/09/24/calling-ssis-from-net/</link>
		<comments>http://arcanecode.com/2009/09/24/calling-ssis-from-net/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 22:43:39 +0000</pubDate>
		<dc:creator>arcanecode</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[DW/BI]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Integration Services]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/09/24/calling-ssis-from-net/</guid>
		<description><![CDATA[In a recent DotNetRocks show, episode 483, Kent Tegels was discussing SQL Server Integration Services and how it can be useful to both the BI Developer as well as the traditional application developer. While today I am a SQL Server BI guy, I come from a long developer background and could not agree more. SSIS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1671&subd=arcanecode&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>In a recent DotNetRocks show, <a href="http://www.dotnetrocks.com/default.aspx?showNum=483" target="_blank">episode 483</a>, Kent Tegels was discussing SQL Server Integration Services and how it can be useful to both the BI Developer as well as the traditional application developer. While today I am a SQL Server BI guy, I come from a long developer background and could not agree more. SSIS is a very powerful tool that could benefit many developers even those not on Business Intelligence projects. It was a great episode, and I high encourage everyone to listen. </p>
<p>There is one point though that was not made very clear, but I think is tremendously important. It is indeed possible to invoke an SSIS package from a .Net application if that SSIS package has been deployed to the SQL Server itself. This article will give an overview of how to do just that. All of the sample code here will also be made available in download form from the companion Code Gallery site, <a href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">http://code.msdn.microsoft.com/ssisfromnet</a> . </p>
<p>In this article, I do assume a few prerequisites. First, you have a SQL Server with SSIS installed, even if it’s just your local development box with SQL Server Developer Edition installed. Second, I don’t get into much detail on how SSIS works, the package is very easy to understand. However you may wish to have a reference handy. You may also need the assistance of your friendly neighborhood DBA in setting up the SQL job used in the process. </p>
<p><b>Summary</b></p>
<p>While the technique is straightforward, there are a fair number of detailed steps involved. For those of you just wanting the overview, we need to start with some tables (or other data) we want to work with. After that we’ll write the SSIS package to manipulate that data. </p>
<p>Once the package is created it must be deployed to the SQL Server so it will know about it. This deploy can be to the file system or to SQL Server. </p>
<p>Once deployed, a SQL Server Job must be created that executes the deployed SSIS package. </p>
<p>Finally, you can execute the job from your .Net application via ADO.NET and a call to the sp_start_job stored procedure built into the msdb system database. </p>
<p>OK, let’s get to coding!</p>
<p><b>Setup the Tables</b></p>
<p>First we need some data to work with. What better than a listing of previous Dot Net Rocks episodes? I simply went to the <a href="http://www.dotnetrocks.com/archives.aspx" target="_blank">Previous Shows</a> page, highlighted the three columns of show number, show name, and date, and saved them to a text file. (Available on the <a href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">Code Gallery</a> site.)</p>
<p>Next we need a place to hold data so SSIS can work with it. I created a database and named it ArcaneCode, however any database should work. Next we’ll create a table to hold “staging” DNR Show data. </p>
<p>CREATE TABLE [dbo].[staging_DNRShows](    <br />&#160; [ShowData] [varchar](250) NOT NULL     <br />) ON [PRIMARY]</p>
<p>This table will hold the raw data from the text file, each line in the text file becoming one row here. Next we want a table to hold the final results.</p>
<p>CREATE TABLE [dbo].[DNRShows](    <br />&#160; [ShowNumber] [int] NOT NULL,     <br />&#160; [ShowName] [varchar](250) NULL,     <br />&#160; [ShowDate] [datetime] NULL,     <br />&#160; CONSTRAINT [PK_DNRShows] PRIMARY KEY CLUSTERED     <br />&#160; (     <br />&#160; [ShowNumber] ASC     <br />&#160; )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]     <br />&#160; ) ON [PRIMARY]     </p>
<p>The job of the SSIS package will be to read each row in the staging table and split it into 3 columns, the show’s number, name, and date, then place those three columns into the DNRShows table above.</p>
<p><b>The SSIS Package</b></p>
<p>The next step is to create the SSIS package itself. Opening up Visual Studio / BIDS, create a new Business Intelligence SQL Server Integration Services project. First let’s setup a shared Data Source to the local server, using the ArcaneCode database as our source. </p>
<p>The default package name of “Package.dtsx” isn’t very informative, so let’s rename it ”LoadDNRShows.dtsx”. Start by adding a reference to the shared data source in the Connection Managers area, taking the default. Then in the Control Flow surface add 3 tasks, as seen here:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image001.jpg"><img style="display:inline;border-width:0;" title="clip_image001" border="0" alt="clip_image001" src="http://arcanecode.files.wordpress.com/2009/09/clip_image001_thumb.jpg?w=339&#038;h=270" width="339" height="270" /></a></p>
<p>The first task is an Execute SQL Task that simply runs a “DELETE FROM dbo.DNRShows” command to wipe out what was already there. Of course in a true application we’d be checking for existing records in the data flow and doing updates or inserts, but for simplicity in this example we’ll just wipe and reload each time.</p>
<p>The final task is also an Execute SQL Task, after we have processed the data we no longer need it in the staging table, so we’ll issue a “DELETE FROM dbo.staging_DNRShows” to remove it. </p>
<p>The middle item is our Data Flow Task. This is what does the heavy lifting of moving the staging data to the main table. Here is a snapshot of what it looks like:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image002.jpg"><img style="display:inline;border-width:0;" title="clip_image002" border="0" alt="clip_image002" src="http://arcanecode.files.wordpress.com/2009/09/clip_image002_thumb.jpg?w=239&#038;h=231" width="239" height="231" /></a></p>
<p>The first task is our OLEDB Source, it references the staging_DNRShows table. Next is what’s called a Derived Column Transformation. This will allow you to add new calculated columns to the flow, or add columns from variables. In this case we want to add three new columns, based on the single column coming from the staging table. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image003.jpg"><img style="display:inline;border-width:0;" title="clip_image003" border="0" alt="clip_image003" src="http://arcanecode.files.wordpress.com/2009/09/clip_image003_thumb.jpg?w=656&#038;h=544" width="656" height="544" /></a></p>
<p>As you can see in under Columns in the upper left, we have one column in our source, ShowData. In the lower half we need to add three new columns, ShowNumber, ShowDate, and ShowName. Here are the expressions for each:</p>
<p>ShowNumber   <br />&#160;&#160;&#160; (DT_I4)SUBSTRING(ShowData,1,FINDSTRING(ShowData,&quot;\t&quot;,1))</p>
<p>ShowDate   <br />&#160;&#160;&#160; (DT_DBDATE)SUBSTRING(ShowData,FINDSTRING(ShowData,&quot;\t&quot;,2) + 1,LEN(ShowData) &#8211; FINDSTRING(ShowData,&quot;\t&quot;,2))</p>
<p>ShowName   <br />&#160;&#160;&#160; (DT_STR,250,1252)SUBSTRING(ShowData,FINDSTRING(ShowData,&quot;\t&quot;,1) + 1,FINDSTRING(ShowData,&quot;\t&quot;,2) &#8211; FINDSTRING(ShowData,&quot;\t&quot;,1) &#8211; 1)</p>
<p>The syntax is an odd blend of VB and C#. Each one starts with a “(DT_”, these are type casts, converting the result of the rest of the expression to what we need. For example, (DT_I4) converts to a four byte integer, which we need because in our database the ShowNumber column was defined as an integer. You will see SUBSTRING and LEN which work like their VB counterparts. FINDSTRING works like the old POS statement, it finds the location of the text and returns that number. The “\t” represents the tab character, here the C# fans win out as the Expression editor uses C# like escapes for special characters. \t for tab, \b for backspace, etc. </p>
<p>Finally we need to write out the data. For this simply add an OLEDB Destination and set it to the target table of dbo.DNRShows. On the mappings tab make sure our three new columns map correctly to the columns in our target table. </p>
<p><b>Deploy the Package</b></p>
<p>This completes the coding for the package, but there is one final step we need to do. First, in the solution explorer right click on the project (not the solution, the project as highlighted below) and pick properties. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image004.jpg"><img style="display:inline;border-width:0;" title="clip_image004" border="0" alt="clip_image004" src="http://arcanecode.files.wordpress.com/2009/09/clip_image004_thumb.jpg?w=311&#038;h=333" width="311" height="333" /></a></p>
<p>In the properties dialog, change the “CreateDeploymentUtility” option from false (the default) to True.</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image006.jpg"><img style="display:inline;border-width:0;" title="clip_image006" border="0" alt="clip_image006" src="http://arcanecode.files.wordpress.com/2009/09/clip_image006_thumb.jpg?w=628&#038;h=383" width="628" height="383" /></a></p>
<p>Now click the Build, Build Solution menu item. If all went well you should see the build was successful. It’s now time to deploy the package to the server. Navigate to the folder where your project is stored, under it you will find a bin folder, and in it a Deployment folder. In there you should find a file with a “.SSISDeploymentManifest” extension. Double click on this file to launch the Package Installation Wizard.</p>
<p>When the wizard appears there are two choices, File system deployment and SQL Server deployment. For our purposes we can use either one, there are pros and cons to each and many companies generally pick one or the other. In this example we’ll pick SQL Server deployment, but again know that I’ve tested this both ways and either method will work. </p>
<p>Once you pick SQL Server deployment, just click Next. Now it asks you for the server name, I’ve left it at (local) since I’m working with this on a development box; likewise I’ve left “Use Windows Authentication”. Finally I need the package path, I can select this by clicking the ellipse (the …) to the right of the text box. This brings up a dialog where I can select where to install. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image007.jpg"><img style="display:inline;border-width:0;" title="clip_image007" border="0" alt="clip_image007" src="http://arcanecode.files.wordpress.com/2009/09/clip_image007_thumb.jpg?w=350&#038;h=304" width="350" height="304" /></a></p>
<p>In a real world production scenario we’d likely have branches created for each of our projects, but for this simple demo we’ll just leave it in the root and click OK. </p>
<p>Once your form is filled out as below, click Next. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image008.jpg"><img style="display:inline;border-width:0;" title="clip_image008" border="0" alt="clip_image008" src="http://arcanecode.files.wordpress.com/2009/09/clip_image008_thumb.jpg?w=505&#038;h=457" width="505" height="457" /></a></p>
<p>We are next queried to what our installation folder should be. This is where SSIS will cache package dependencies. Your DBA may have a special spot setup for these, if not just click next to continue.</p>
<p>Finally we are asked to confirm we know what we are doing. Just click Next. If all went well, the install wizard shows us it’s happy with a report, and we can click Finish to exit. </p>
<p><b>Setup the SQL Server Job</b></p>
<p>We’ve come a long way and we’re almost to the finish line, just one last major step. We will need to setup a SQL Server Job which will launch the SSIS package for us. In SQL Server Management Studio, navigate to the “SQL Server Agent” in your Object Explorer. If it’s not running, right click and pick “Start”. Once it’s started, navigate to the Jobs branch. Right click and pick “New Job”. </p>
<p>When the dialog opens, start by giving your job a name. As you can see below I used LoadDNRShows. I also entered a description. </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image010.jpg"><img style="display:inline;border-width:0;" title="clip_image010" border="0" alt="clip_image010" src="http://arcanecode.files.wordpress.com/2009/09/clip_image010_thumb.jpg?w=628&#038;h=564" width="628" height="564" /></a></p>
<p>Now click on the Jobs page over on the left “Select a page” menu. At the bottom click “New” to add a new job step. </p>
<p>In the job step properties dialog, let’s begin by naming the step “Run the SSIS package”. Change the Type to “SQL Server Integration Services Package”. When you do, the dialog will update to give options for SSIS. Note the Run As drop down, this specifies the account to run under. For this demo we’ll leave it as the SQL Server Agent Service Account, check with your DBA as he or she may have other instructions. </p>
<p>In the tabbed area the General tab first allows us to pick the package source. Since we deployed to SQL Server we’ll leave it at the default, however if you had deployed to the file system this is where you’d need to change it to pick your package. </p>
<p>At the bottom we can use the ellipse to pick our package from a list. That done your screen should look something like:</p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image011.jpg"><img style="display:inline;border-width:0;" title="clip_image011" border="0" alt="clip_image011" src="http://arcanecode.files.wordpress.com/2009/09/clip_image011_thumb.jpg?w=491&#038;h=497" width="491" height="497" /></a></p>
<p>For this demo that’s all we need to set, I do want to take a second to encourage you to browse through the other tabs. Through these tabs you can set many options related to the package. For example you could alter the data sources, allowing you to use one package with multiple databases. </p>
<p>Click OK to close the job step, then OK again to close the Job Properties window. Your job is now setup!</p>
<p><b>Calling from .Net</b></p>
<p>The finish line is in sight! Our last step is to call the job from .Net. To make it a useful example, I also wanted the .Net application to upload the data the SSIS package will manipulate. For simplicity I created a WinForms app, but this could easily be done in any environment. I also went with C#, again the VB.Net code is almost identical. </p>
<p>I started by creating a simple WinForm with two buttons and one label. (Again the full project will be on the <a href="http://code.msdn.microsoft.com/ssisfromnet" target="_blank">Code Gallery</a> site). </p>
<p><a href="http://arcanecode.files.wordpress.com/2009/09/clip_image012.jpg"><img style="display:inline;border-width:0;" title="clip_image012" border="0" alt="clip_image012" src="http://arcanecode.files.wordpress.com/2009/09/clip_image012_thumb.jpg?w=352&#038;h=165" width="352" height="165" /></a></p>
<p>In the code, first be sure to add two using statements to the standard list:</p>
<p>using System.Data.SqlClient;</p>
<p>using System.IO;</p>
<p>Behind the top button we’ll put the code to copy the data from the text file we created from the DNR website to the staging table. </p>
<div style="font-family:consolas;background:white;color:black;font-size:10pt;">
<p style="margin:0;">&#160;&#160;&#160; <span style="color:blue;">private</span> <span style="color:blue;">void</span> btnLoadToStaging_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</p>
<p style="margin:0;">&#160;&#160;&#160; {</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">/* This method takes the data in the DNRShows.txt file and uploads them to a staging table */</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">/* The routine is nothing magical, standard stuff to read as Text file and upload it to a&#160; */</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">/* table via ADO.NET&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */</span></p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// Note, be sure to change to your correct path</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> filename = <span style="color:#a31515;">@&quot;D:\Presentations\SQL Server\Calling SSIS From Stored Proc\DNRShows.txt&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> line;</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// If you used a different db than ArcaneCode be sure to set it here</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> connect = <span style="color:#a31515;">&quot;server=localhost;Initial Catalog=ArcaneCode;Integrated Security=SSPI;&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SqlConnection</span> connection = <span style="color:blue;">new</span> <span style="color:#2b91af;">SqlConnection</span>(connect);</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; connection.Open();</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SqlCommand</span> cmd = connection.CreateCommand();</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// Wipe out previous data in case of a crash</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> sql = <span style="color:#a31515;">&quot;DELETE FROM dbo.staging_DNRShows&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.CommandText = sql;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.ExecuteNonQuery();</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// Now setup for new inserts</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; sql = <span style="color:#a31515;">&quot;INSERT INTO dbo.staging_DNRShows (ShowData) VALUES (@myShowData)&quot;</span>;</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.CommandText = sql;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.Parameters.Add(<span style="color:#a31515;">&quot;@myShowData&quot;</span>, <span style="color:#2b91af;">SqlDbType</span>.VarChar, 255);</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">StreamReader</span> sr = <span style="color:blue;">null</span>;</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// Loop thru text file, insert each line to staging table</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">try</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; {</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; sr = <span style="color:blue;">new</span> <span style="color:#2b91af;">StreamReader</span>(filename);</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; line = sr.ReadLine();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">while</span> (line != <span style="color:blue;">null</span>)</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cmd.Parameters[<span style="color:#a31515;">&quot;@myShowData&quot;</span>].Value = line;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cmd.ExecuteNonQuery();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lblProgress.Text = line;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; line = sr.ReadLine();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; }</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">finally</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; {</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">if</span> (sr != <span style="color:blue;">null</span>)</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sr.Close();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; connection.Close();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; lblProgress.Text = <span style="color:#a31515;">&quot;Data has been loaded&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; }</p>
<p style="margin:0;">&#160;</p>
</p></div>
<p>Before you ask, yes I could have used any number of data access technologies, such as LINQ. I went with ADO.NET for simplicity and believing most developers are familiar with it due to its longevity. Do be sure and update the database name and path to the file in both this and the next example when you run the code. </p>
<p>This code really does nothing special, just loops through the text file and uploads each line as a row in the staging table. It does however serve as a realistic example of something you’d do in this scenario, upload some data, then let SSIS manipulate it on the server. </p>
<p>Once the data is there, it’s finally time for the grand finale. The code behind the second button, Execute SSIS, does just what it says; it calls the job, which invokes our SSIS package. </p>
<div style="font-family:consolas;background:white;color:black;font-size:10pt;">
<p style="margin:0;">&#160;&#160;&#160; <span style="color:blue;">private</span> <span style="color:blue;">void</span> btnRunSSIS_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</p>
<p style="margin:0;">&#160;&#160;&#160; {</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> connect = <span style="color:#a31515;">&quot;server=localhost;Initial Catalog=ArcaneCode;Integrated Security=SSPI;&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SqlConnection</span> connection = <span style="color:blue;">new</span> <span style="color:#2b91af;">SqlConnection</span>(connect);</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; connection.Open();</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SqlCommand</span> cmd = connection.CreateCommand();</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:green;">// Wipe out previous data in case of a crash</span></p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">string</span> sql = <span style="color:#a31515;">&quot;exec msdb.dbo.sp_start_job N&#8217;LoadDNRShows&#8217;&quot;</span>;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.CommandText = sql;</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; cmd.ExecuteNonQuery();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; connection.Close();</p>
<p style="margin:0;">&#160;&#160;&#160;&#160;&#160; lblProgress.Text = <span style="color:#a31515;">&quot;SSIS Package has been executed&quot;</span>;</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;">&#160;&#160;&#160; }</p>
</p></div>
<p>The key is this sql command:</p>
<p>exec msdb.dbo.sp_start_job N’LoadDNRShows’</p>
<p>“exec” is the T-SQL command to execute a stored procedure. “sp_start_job” is the stored procedure that ships with SQL Server in the MSDB system database. This stored procedure will invoke any job stored on the server. In this case, it invokes the job “LoadDNRShows”, which as we setup will run an SSIS package. </p>
<p>Launch the application, and click the first button. Now jump over to SQL Server Management Studio and run this query:</p>
<p>select * from dbo.staging_DNRShows;</p>
<p>select * from dbo.DNRShows;</p>
<p>You should see the first query bring back rows, while the second has nothing. Now return to the app and click the “Execute SSIS” button. If all went well running the query again should now show no rows in our first query, but many nicely processed rows in the second. Success!</p>
<p><b>A few thoughts about xp_cmdshell</b></p>
<p>In researching this article I saw many references suggesting writing a stored procedure that uses xp_cmdshell to invoke dtexec. DTEXEC is the command line utility that you can use to launch SSIS Packages. Through it you can override many settings in the package, such as connection strings or variables. </p>
<p>xp_cmdshell is a utility built into SQL Server. Through it you can invoke any “DOS” command. Thus you could dynamically generate a dtexec command, and invoke it via xp_cmdshell. </p>
<p>The problem with xp_cmdshell is you can use it to invoke ANY “DOS” command. Any of them. Such as oh let’s say “DEL *.*” ? xp_cmdshell can be a security hole, for that reason it is turned off by default on SQL Server, and many DBA’s leave it turned off and are not likely to turn it on. </p>
<p>The techniques I’ve demonstrated here do not rely on xp_cmdshell. In fact, all of my testing has been done on my server with the xp_cmdshell turned off. Even though it can be a bit of extra work, setting up the job, etc., I still advise it over the xp_cmdshell method for security and the ability to use it on any server regardless of its setting. </p>
<p><b>In Closing</b></p>
<p>That seemed like a lot of effort, but can lead to some very powerful solutions. SSIS is a very powerful tool designed for processing large amounts of data and transforming it. In addition developing under SSIS can be very fast due to its declarative nature. The sample package from this article took the author less than fifteen minutes to code and test. </p>
<p>When faced with a similar task, consider allowing SSIS to handle the bulk work and just having your .Net application invoke your SSIS package. Once you do, there are no ends to the uses you’ll find for SQL Server Integration Services. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arcanecode.wordpress.com/1671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arcanecode.wordpress.com/1671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arcanecode.wordpress.com/1671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arcanecode.wordpress.com/1671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arcanecode.wordpress.com/1671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arcanecode.wordpress.com/1671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arcanecode.wordpress.com/1671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arcanecode.wordpress.com/1671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arcanecode.wordpress.com/1671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arcanecode.wordpress.com/1671/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arcanecode.com&blog=340781&post=1671&subd=arcanecode&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://arcanecode.com/2009/09/24/calling-ssis-from-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8436cd3ff437697b2608405422efa4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arcanecode</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image001_thumb.jpg" medium="image">
			<media:title type="html">clip_image001</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image002_thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image003_thumb.jpg" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image004_thumb.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image006_thumb.jpg" medium="image">
			<media:title type="html">clip_image006</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image007_thumb.jpg" medium="image">
			<media:title type="html">clip_image007</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image008_thumb.jpg" medium="image">
			<media:title type="html">clip_image008</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image010_thumb.jpg" medium="image">
			<media:title type="html">clip_image010</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image011_thumb.jpg" medium="image">
			<media:title type="html">clip_image011</media:title>
		</media:content>

		<media:content url="http://arcanecode.files.wordpress.com/2009/09/clip_image012_thumb.jpg" medium="image">
			<media:title type="html">clip_image012</media:title>
		</media:content>
	</item>
	</channel>
</rss>