<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35862303</id><updated>2012-01-26T11:47:06.920-05:00</updated><category term='WHEN Clause'/><category term='Visual Studio'/><category term='sox'/><category term='Virtual PC'/><category term='DTS'/><category term='Report Manager'/><category term='data mining'/><category term='dashboards'/><category term='Printing Reports'/><category term='PerformancePoint Server'/><category term='SQL Server 2000'/><category term='sarbanes oxley'/><category term='Environment Variables'/><category term='Filestream'/><category term='SSMS'/><category term='Analysis Services'/><category term='PPS Planning'/><category term='Data Corruption'/><category term='Backup'/><category term='Pie Chart'/><category term='Debugging'/><category term='Parent Hierarchy'/><category term='Error'/><category term='Cube Roles'/><category term='report export'/><category term='SSIS'/><category term='Partitioned Table'/><category term='SQL Server BI scalability'/><category term='LINQ'/><category term='RSClientPrint.cab'/><category term='scalability'/><category term='Dashboard designer'/><category term='SQL Server 2005'/><category term='Integrated Mode'/><category term='SharePoint 2010'/><category term='Change Data Capture'/><category term='Precedence Constraints'/><category term='SSIS Extract Dynamic Data Driven Package Variables Expressions'/><category term='Flat File Load'/><category term='PerformancePoint Security'/><category term='Calculated Member'/><category term='SSRS 2005'/><category term='Backup Task'/><category term='SSAS'/><category term='SSRS'/><category term='Lookup'/><category term='Deadlock in OpenXML'/><category term='HTTP Handlers'/><category term='T-SQL'/><category term='MDX'/><category term='Named Instance'/><category term='SSIS configurations'/><category term='SQL Server 2008 Policy Management Policies Factets Exporting Current State'/><category term='Crystal Reports'/><category term='MOSS 2007'/><category term='cache'/><category term='SQL Server'/><category term='Replication'/><category term='RSClientPrint.dll'/><category term='Service Pack'/><category term='MERGE Statement'/><category term='business intelligence'/><category term='Oracle'/><category term='Best Practice'/><category term='Data Pump'/><category term='SQL Server 2000 DTS Designer Components'/><category term='sharepoint'/><category term='auditing'/><category term='SQL Server Management Studio'/><category term='excel'/><category term='technet'/><category term='XML Path'/><category term='forrester'/><category term='Clustering'/><category term='SQL Azure'/><category term='Cube Perspective'/><category term='WHERE in MERGE'/><category term='ASSPIInstallFarmAction'/><category term='BLOB'/><category term='Report Viewer'/><category term='OSQL'/><category term='SQL Server 2008'/><category term='Maintenance Plan'/><category term='Performance Management'/><category term='Pivot Transformation'/><category term='PPS Monitoring'/><category term='videos'/><category term='migration'/><category term='Reporting Services'/><category term='Web Service'/><category term='Maintenance'/><category term='Gadir'/><category term='click once'/><category term='PPS Analytics'/><category term='ACQUIRECONNECTION'/><category term='Management Studio'/><category term='Performance Point'/><category term='BI'/><category term='Copy Results'/><category term='DatAllegro'/><category term='compliance'/><category term='microsoft'/><category term='SSRS 2008'/><category term='SQL Server 2008 R2'/><category term='datawarehouse'/><category term='Training'/><category term='Tips and Tricks'/><category term='CHANGETABLE'/><category term='Books'/><title type='text'>RDA BI/SQL Server Practice Group Blog</title><subtitle type='html'>Discussing business intelligence and database technologies, data warehousing, and performance management</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default?start-index=101&amp;max-results=100'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>162</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35862303.post-6600753764184379421</id><published>2011-10-13T21:12:00.001-04:00</published><updated>2011-10-13T21:16:42.111-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Path'/><title type='text'>Using FOR XML PATH to Combine Multiple Record Values into One Column</title><content type='html'>&lt;h4&gt;Scenario&lt;/h4&gt;  &lt;p&gt;I have been asked on numerous occasions to provide a data feed that provides data for a customer, or plant or some other entity with a catch, can you take a one to many relationship and make one column of data out of it. That answer, of course, is “Sure, I can do anything!”&amp;#160; but then I get into the how and I start to build a stored procedure that uses temp tables, involves a WHILE loop of some kind and I have to manually code the correct answer. The process is nothing complicated but it definitely involved some extra steps before providing back the results.&lt;/p&gt;  &lt;p&gt;My thinking though is that it would be great if I could do that in a SQL statement and let SQL Server do all of the work. Low and behold, I ran across a method that turned my original process into a single query statement, which obviously is much simpler!&lt;/p&gt;  &lt;h4&gt;Example Data Set&lt;/h4&gt;  &lt;p&gt;To illustrate, I have the following scenario:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Please provide a Customer list by State and include all of the Customer Regions in one column on each state’s row. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Simple request but the issue is that within a state, I have multiple regions depending on a postal code of the address of the customer office.&lt;/p&gt;  &lt;p&gt;In my sample database, my data is broken out into three tables: (for the sake of being able to create this locally as an example, I have done everything in tempdb)&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;create&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomer&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;identity&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; CustomerName &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;max&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;))&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;create&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomerAddress&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;AddressId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;identity&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; CustomerId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; StateAbbreviation &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;5&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PostalCode &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;10&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;))&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;create&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpPostalCode&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCodeId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;identity&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PostalCode &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;20&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PostalRegion &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;30&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;))&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The relationships are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A customer can have multiple addresses &lt;/li&gt;    &lt;li&gt;For a state, you can have multiple regions based upon the postal code &lt;/li&gt;    &lt;li&gt;The postal code belongs to a postal region &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;These relationships imply that a customer can have multiple regions per state as well, where the postal code of the customer address will map to the region.&lt;/p&gt;  &lt;p&gt;For sample data, the following inserts are executed:&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;insert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;into&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomer&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerName&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'Customer A'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;insert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;into&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomerAddress&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; StateAbbreviation&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PostalCode&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; 1&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'PA'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'19111'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;union&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; 1&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'PA'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'19103'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; 1&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'NJ'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'08034'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;insert&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;into&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpPostalCode&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; PostalRegion&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'19111'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'NE Philly'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'19103'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'Center City'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'08034'&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#ff0000"&gt;'South Jersey'&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;Query Solution&lt;/h4&gt;  &lt;p&gt;Now, if we queried the data using straight joins we would get the following:&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;c&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerName&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;ca&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;StateAbbreviation&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;pc&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalRegion&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;from&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;#tmpCustomer c&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;inner&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;join&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomerAddress ca&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; c&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;inner&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;join&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpPostalCode pc&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; pc&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table style="line-height: normal; border-collapse: collapse" border="0" cellspacing="0" cellpadding="0" width="480"&gt;&lt;colgroup&gt;&lt;col style="width: 96pt; mso-width-source: userset; mso-width-alt: 4551" width="128" /&gt;&lt;col style="width: 107pt; mso-width-source: userset; mso-width-alt: 5091" width="143" /&gt;&lt;col style="width: 85pt; mso-width-source: userset; mso-width-alt: 4039" width="114" /&gt;&lt;/colgroup&gt;&lt;tbody&gt;     &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" height="23" width="160"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;CustomerName&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" width="178"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;StateAbbreviation&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" width="141"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;PostalRegion&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66" height="23"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Customer A&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;NJ&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;South Jersey&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66" height="23"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Customer A&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;PA&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Center City&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66" height="23"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Customer A&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;PA&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;NE Philly&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;However, the above dataset does not provide the solution, the request is to roll up the State Regions for the customer into one row per state.&lt;/p&gt;  &lt;p&gt;The following query gives us the answer:&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;distinct&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;c&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerName&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;ca&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;StateAbbreviation&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#ff00ff"&gt;substring&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;'; '&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;+&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ipc&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalRegion&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpPostalCode ipc&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;inner&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;join&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomerAddress ica&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ipc&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ica&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;where&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;ica&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;and&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ica&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;StateAbbreviation &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;StateAbbreviation&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;path&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;''&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;)),&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; 3&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; 1000&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Region &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; color: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;from&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;#tmpCustomer c&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;inner&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;join&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpCustomerAddress ca&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; c&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;CustomerId&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"&gt;&lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;inner&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;join&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; #tmpPostalCode pc&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ca&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; pc&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;PostalCode&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font color="#000000"&gt;Here are the results:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table style="line-height: normal; border-collapse: collapse" border="0" cellspacing="0" cellpadding="0" width="501"&gt;&lt;colgroup&gt;&lt;col style="width: 96pt; mso-width-source: userset; mso-width-alt: 4551" width="128" /&gt;&lt;col style="width: 107pt; mso-width-source: userset; mso-width-alt: 5091" width="143" /&gt;&lt;col style="width: 98pt; mso-width-source: userset; mso-width-alt: 4664" width="131" /&gt;&lt;/colgroup&gt;&lt;tbody&gt;     &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" height="23" width="160"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;CustomerName&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" width="178"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;StateAbbreviation&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl65" width="163"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&lt;strong&gt;Region&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66" height="23"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Customer A&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;NJ&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;South Jersey&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="height: 14.4pt" height="19"&gt;       &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66" height="23"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Customer A&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;PA&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;        &lt;td style="border-bottom: windowtext 0.5pt solid; border-left: medium none; padding-left: 1px; padding-right: 1px; vertical-align: bottom; border-top: medium none; border-right: windowtext 0.5pt solid; padding-top: 1px" class="xl66"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;Center City; NE Philly&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;   &lt;br /&gt;The key of the query is using the &lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;path&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;''&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;) &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;syntax as a subquery in the select portion of the field list, as well as using the &lt;span style="font-family: ; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-no-proof: yes"&gt;&lt;font style="font-size: 9pt"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9pt" color="#0000ff"&gt;distinct &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;keyword to remove duplicate entries. &lt;/p&gt;  &lt;p&gt;To note, the &lt;font style="font-size: 9pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;path&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;''&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;) &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;statement would put in xml tags if the column was named in the subquery but since we left the column name empty when we concatenated the semicolon and the postal region, the xml nodes are empty. The extra substring is just to parse off the preceding delimiter that we start all records with.&lt;/p&gt;  &lt;p&gt;The above example could then be used as an inner query tied to other tables within the database for more fields that are also at a single Customer State level.&lt;/p&gt;  &lt;h4&gt;Conclusion&lt;/h4&gt;  &lt;p&gt;As the above example showed, the ability to roll up a one to many relationship into a single row set can be be very useful and it would have saved me time in the past if I had come across this method earlier. In addition, having the ability to do this using one T-SQL statement as opposed to having to generate a loop and a procedure to build your dataset is definitely a simpler and in my opinion a better answer.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6600753764184379421?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6600753764184379421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6600753764184379421' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6600753764184379421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6600753764184379421'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/10/using-for-xml-path-to-combine-multiple.html' title='Using FOR XML PATH to Combine Multiple Record Values into One Column'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-686390478854360110</id><published>2011-10-03T22:57:00.001-04:00</published><updated>2011-10-03T22:57:31.972-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='scalability'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Partitioned Table'/><title type='text'>Database Partitioning with the Entity Framework</title><content type='html'>&lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Problem&lt;/h3&gt;  &lt;p&gt;Requirements on a recent project called for a cloud-based solution and support for a lot of data. Microsoft Windows Azure was selected as the platform and Microsoft SQL Azure was selected for the database. How much is a lot of data? It was expected to be much greater than 50GB. Now we had a problem, since the maximum size of a SQL Azure database was 50GB and SQL Azure Federation has not yet been released.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Solution&lt;/h3&gt;  &lt;p&gt;An additional technical requirement for the solution was to use the latest Microsoft Entity Framework. A ready-made solution for database partitioning on SQL Azure with the Entity Framework was not to be found, so we developed our own implementation. The key features of the solution included:&lt;/p&gt;  &lt;p&gt;1. Minimal impact to the development team, who were already familiar with EF&lt;/p&gt;  &lt;p&gt;2. Ability to add additional databases on-the-fly as one or more database approached capacity&lt;/p&gt;  &lt;p&gt;3. Self-leveling of the databases: they should effectively grow at the same rate.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Partitioning Strategy&lt;/h3&gt;  &lt;p&gt;Regardless of the implementation, selecting the appropriate partitioning strategy is critical. We chose a horizontal partition. The Atomic Unit for the partition (or shard) was a Customer. All transactions (Orders) and other data related to a Customer are in the same shard. The benefits of horizontal partitioning in this manner include:&lt;/p&gt;  &lt;p&gt;1. Performance: Once a customer was selected, all database activity for that customer was in the same database. There was no spanning of databases to store or retrieve data related to the current customer. Only Customer searches needed to span databases.&lt;/p&gt;  &lt;p&gt;2. Self-leveling: The logic for which database to insert the next new customer was simple – always add to the smallest database.&lt;/p&gt;  &lt;p&gt;3. Positioned for Growth: Additional databases could be added without having to re-partition or divide existing data.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Implementation Details&lt;/h3&gt;  &lt;p&gt;The two main areas of the solution that required enhancements to an otherwise ‘standard’ EF implementation were searches and management of connection strings. Searches had to span databases and return which database a customer was found in as part of the result. Likewise, knowing which database a specific customer belonged to had to be easily passed into EF methods and translated to full connection strings when necessary.&lt;/p&gt;  &lt;h4&gt;Searches&lt;/h4&gt;  &lt;p&gt;We chose parallel LINQ queries for searches. See below for an example. An array of connections (how many shard databases we currently have) is maintained in a static ConnectionFactory. So, c.Item1 in the final select below contains the shard where the result was found. c.Item2 contains the full connection string passed into the query.Invoke().&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="1"&gt;public static IEnumerable&amp;lt;TResult&amp;gt; ExecuteAgainstShards&amp;lt;TArg0, TArg1, TResult, TPreShape&amp;gt;(&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;this Func&amp;lt;TArg0, TArg1, IEnumerable&amp;lt;TPreShape&amp;gt;&amp;gt; query, TArg1 arg1, Func&amp;lt;string, TPreShape, TResult&amp;gt; shapeResult) where TArg0 : ObjectContext, new()&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;{&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;var result = from c in ConnectionFactory.Instance.CreateConnections&amp;lt;TArg0&amp;gt;().AsParallel()&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;from x in ExecuteWithRetry(() =&amp;gt; query.Invoke(c.Item2, arg1))&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;a name="OLE_LINK2"&gt;&lt;/a&gt;&lt;a name="OLE_LINK1"&gt;&lt;font size="1"&gt;select&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt; shapeResult(c.Item1, x);&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;return result.ToArray();&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The web.config contains only the connection string for the first shard and there are some helper methods to parse and create connection strings as needed to access the remaining shards. The web.config (or ServiceConfiguration.cscfg in Windows Azure) also contains the number of active shards used by the ConnectionFactory. This provides the mechanism for adding databases without changing code or adding additional connection strings.&lt;/p&gt;  &lt;p&gt;Below is an example compiled query and its calling method that leverage the ExecuteAgainstShards parallel execution.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="1"&gt;private readonly Func&amp;lt;MyEntities, CustomerSearchTerms, IQueryable&amp;lt;Data.Person&amp;gt;&amp;gt; customerSearch = CompiledQuery.Compile&amp;lt;MyEntities, CustomerSearchTerms, IQueryable&amp;lt;Data.Person&amp;gt;&amp;gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(es, search) =&amp;gt; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;from p in es.People&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;where&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;p.Customers.Count() &amp;gt;= 1 &amp;amp;&amp;amp; (search.CustomersId == null || &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;p.Customers.Count(e =&amp;gt; e. CustomerID == search. CustomerId) &amp;gt; 0) &amp;amp;&amp;amp;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(string.IsNullOrEmpty(search.FirstName) || p.FirstName.StartsWith(search.FirstName)) &amp;amp;&amp;amp;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(string.IsNullOrEmpty(search.LastName) || p.LastName.StartsWith(search.LastName)) &amp;amp;&amp;amp;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;select p&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;);&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;public IEnumerable&amp;lt;CustomerPersonReference&amp;gt; FindCustomer(CustomerSearchTerms terms)&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;{&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;var items = customerSearch.ExecuteAgainstShards&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;terms,&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;(shardName, person) =&amp;gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;{&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;var patient = person.Customers.First();&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;return new CustomerPersonReference&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;( CommonRoutines.MapHeader(person, shardName),&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;});&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;return items.OrderBy(p =&amp;gt; p.Item1.LastName).ThenBy(p =&amp;gt; p.Item1.FirstName). ToArray();&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Connection Strings&lt;/h4&gt;  &lt;p&gt;As mentioned above, once a Customer has been found in a specific shard, all data related to that Customer will be and must be in that shard. In addition to the shard helper methods for generating and parsing connection string, the development team needed to be disciplined to always use the EF constructor that included a connection string. For example:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="1"&gt;using (var entities = new MyEntities(ShardUtilities.GetConnectionString(customerShard))&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;{&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;// real work goes here&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;where customerShard is likely the shard returned from the search query above.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;Implementation of a database partitioning solution with the Microsoft Entity Framework was necessary to overcome the current SQL Azure database size limitation. But, the solution is certainly not limited to SQL Azure. If you are using a version of Microsoft SQL Server that does not support partitioning or if you want to maintain a database solution that will work with either SQL Azure or on-premise SQL Server, this fairly straightforward implementation might come in handy.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-686390478854360110?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/686390478854360110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=686390478854360110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/686390478854360110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/686390478854360110'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/10/database-partitioning-with-entity.html' title='Database Partitioning with the Entity Framework'/><author><name>Chris</name><uri>http://www.blogger.com/profile/06517951200558072779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-2362772352996375923</id><published>2011-09-16T08:44:00.006-04:00</published><updated>2011-09-16T09:22:38.526-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='click once'/><category scheme='http://www.blogger.com/atom/ns#' term='Dashboard designer'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='dashboards'/><category scheme='http://www.blogger.com/atom/ns#' term='PPS Analytics'/><category scheme='http://www.blogger.com/atom/ns#' term='Gadir'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance Point'/><title type='text'>Where is my Dashboard designer?</title><content type='html'>&lt;div class="MsoNormal"&gt;Finding SharePoint performance point &lt;b&gt;&lt;a href="http://office.microsoft.com/en-us/performancepoint-server/CH010257425.aspx"&gt;Dashboard designer&lt;/a&gt;&lt;/b&gt; tool was a little tricky. It’s a click once download that is not available anywhere in MSDN downloads or any other place. However you can download it from your Business Intelligence Center page in SharePoint.&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;To make your life easier, if you ever need it and you already have PerformancePoint installed on your SharePoint sever then here is how you can get it:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Open your browser as an admin user&lt;/li&gt;&lt;li&gt;Go to this URL http://&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;lt;server-name&amp;gt;&lt;/span&gt;/sites/&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&amp;lt;site-name&amp;gt;&lt;/span&gt;/pages/ppssample.aspx&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;&lt;span class="Apple-style-span" style="color: #134f5c;"&gt;“Run Dashboard Designer”&lt;/span&gt;&lt;/b&gt; and let it download the tool for you.&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal"&gt;In highly customized SharePoint 2010 sites this page can be hard to find. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-2362772352996375923?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/2362772352996375923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=2362772352996375923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2362772352996375923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2362772352996375923'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/09/where-is-my-dashboard-designer.html' title='Where is my Dashboard designer?'/><author><name>Ahmed Gadir</name><uri>http://www.blogger.com/profile/14150236483419535999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/-dc2LY8IYS1E/TnJYCvmqqpI/AAAAAAAACyI/VqqDyucV0sA/s220/face.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5155687681621229389</id><published>2011-06-10T14:34:00.004-04:00</published><updated>2011-06-10T15:05:08.400-04:00</updated><title type='text'>Scale Breaks in SSRS 2008 R2</title><content type='html'>&lt;span style="font-size:85%;"&gt;Ever came across an issue when in your chart some axis values are so high that rest of the chart items almost look like they do not have any values? I recently came across the same issue and thanks to SQL Reporting Services 2008 R2's new Scale Break feature which made my charts look more meaningful.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i.msdn.microsoft.com/dynimg/IC5690.gif"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 411px; FLOAT: left; HEIGHT: 248px; CURSOR: hand" border="0" alt="" src="http://i.msdn.microsoft.com/dynimg/IC5690.gif" /&gt;&lt;/a&gt;&lt;strong&gt;To enable scale breaks on the chart&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;1. Right-click the vertical axis and then open "Axis Properties".&lt;br /&gt;2. Select the "Enable scale breaks" check box.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;To change the style of the scale break&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;1. On the design surface, right-click on the y-axis of the chart. The properties for the y-axis object are displayed in the Properties pane.&lt;br /&gt;2. In the Scale section, expand the ScaleBreakStyle property.&lt;br /&gt;3. Change the values for ScaleBreakStyle properties, such as BreakLineType and Spacing.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Note:&lt;/strong&gt; You cannot specify where to place a scale break on your chart. The chart uses its own calculations based on the values in your dataset to determine whether there is sufficient separation between data ranges to draw a scale break on the value axis (y-axis) at run time.&lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5155687681621229389?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5155687681621229389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5155687681621229389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5155687681621229389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5155687681621229389'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/06/scale-breaks-in-ssrs-2008-r2.html' title='Scale Breaks in SSRS 2008 R2'/><author><name>Aneel Ismaily</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/__RkG8rOS6tU/S6OBv50pycI/AAAAAAAACNA/ThL59_tHAQU/S220/IsmailyAneel.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4484930164457596145</id><published>2011-05-27T10:55:00.002-04:00</published><updated>2011-05-27T11:04:54.066-04:00</updated><title type='text'>File system error: The following error occurred during a file operation: There is not enough space on the disk.</title><content type='html'>Since last two days my package which processes 30+ dimensions and a cube was failing with the File system error. Package was complaining that we were running out of space on file system. I checked both SSIS server and SQL Server and space was not an issue at all. After spending some time on troubleshooting I realized that when we were processing all dimensions in one ssas processing task (ssis task), package was throwing "out of space" error but after breaking the dimension processing task into multiple tasks by dividing dimensions equally into three tasks, package started running successfully for me. Now if you come across the same issue then you know what you need to do. break your dimension processing task into multiple tasks by dividing dimensions equally into multiple tasks. I am processing no more than 15 dimensions in one task.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4484930164457596145?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4484930164457596145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4484930164457596145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4484930164457596145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4484930164457596145'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/05/file-system-error-following-error.html' title='File system error: The following error occurred during a file operation: There is not enough space on the disk.'/><author><name>Aneel Ismaily</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/__RkG8rOS6tU/S6OBv50pycI/AAAAAAAACNA/ThL59_tHAQU/S220/IsmailyAneel.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-2765465762250527741</id><published>2011-05-06T14:48:00.002-04:00</published><updated>2011-05-06T14:57:33.387-04:00</updated><title type='text'>Microsoft BI Labs</title><content type='html'>&lt;p&gt;Microsoft recently launched a new site called, "Microsoft BI Labs".&lt;br /&gt;&lt;a href="http://www.microsoft.com/bi/en-us/Community/BILabs/Pages/Home.aspx"&gt;&lt;span style="color:#004477;"&gt;http://www.microsoft.com/bi/en-us/Community/BILabs/Pages/Home.aspx&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As shared on their site, "BI Labs is a collection of experimental business intelligence projects and useful applications made available from internal sources across Microsoft. These projects are prototypes and concepts, and there are no current plans to include them in Microsoft products." &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Those of you who are interested in learning more about upcoming techonologies in BI world, this might be a great resource for them. They already have some interesting technologies shared on their site e.g. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;1- PivotViewer Extension for Microsoft SQL Server Reporting Services &lt;/p&gt;&lt;br /&gt;&lt;p&gt;2- Microsoft SQL Server Data Mining for the Cloud&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3- Fuzzy Lookup Add-in for Microsoft Excel 2010&lt;/p&gt;&lt;br /&gt;&lt;p&gt;4- MDX and DAX Formatter&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5- Microsoft SQL Server Reporting Services Log Viewer&lt;/p&gt;&lt;br /&gt;&lt;p&gt;6- BI vision in multiple industries (Video Series)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Enjoy!!!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-2765465762250527741?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/2765465762250527741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=2765465762250527741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2765465762250527741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2765465762250527741'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/05/microsoft-bi-labs.html' title='Microsoft BI Labs'/><author><name>Aneel Ismaily</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/__RkG8rOS6tU/S6OBv50pycI/AAAAAAAACNA/ThL59_tHAQU/S220/IsmailyAneel.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-8845576225823908238</id><published>2011-04-22T10:32:00.001-04:00</published><updated>2011-04-22T10:32:02.281-04:00</updated><title type='text'>Microsoft SharePoint 2010 Business Intelligence Unleashed Book</title><content type='html'>&lt;p&gt;&lt;a href="http://www.informit.com/store/product.aspx?isbn=0132660113"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="BI SharePoint Book Cover" border="0" alt="BI SharePoint Book Cover" src="http://lh4.ggpht.com/_Bb_dqfXVtDU/TbGRYY-pSFI/AAAAAAAAAGI/iBWmciJ6GsQ/BI%20SharePoint%20Book%20Cover%5B3%5D.jpg?imgmax=800" width="164" height="214" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Several members from the RDA BI team have put together an Unleashed Series book covering Business Intelligence with SharePoint 2010 and can be found online at the following link: &lt;a href="http://www.informit.com/store/product.aspx?isbn=0132660113"&gt;http://www.informit.com/store/product.aspx?isbn=0132660113&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The release date for the book is May 9th, 2011 and was written by: Chuck Rivel, Ray Barley, Jim Pletscher, Aneel Ismaily and Steve Mann (who was the original editor of the RDA Blog site and former team lead for the RDA BI Team)&lt;/p&gt;  &lt;p&gt;The book covers working with the Microsoft BI stack for SQL Server 2008 R2 and SharePoint 2010, which involves the following services and applications: PerformancePoint Services, Reporting Services, PowerPivot, Visio Services and the SharePoint 2010 Business Intelligence Center.&lt;/p&gt;  &lt;p&gt;The following is the the official book description as published on the informIT website:&lt;/p&gt;  &lt;p&gt;“SharePoint 2010 is rapidly emerging as the preferred presentation and deployment system for Business Intelligence (BI) solutions that use the Microsoft technology stack. This is a complete guide to both SharePoint 2010 and BI. This book reflects the unsurpassed real-world experience of five expert consultants at RDA, a Microsoft Gold Partner specializing in delivering advanced BI solutions with SharePoint. The authors offer practical, how-to guidance for every key task involved in building, configuring, and deploying BI solutions within a SharePoint environment, delivering crucial information that can't be found in any other book. They bridge the gap between SharePoint 2010 and SQL Server 2008, carefully guiding technical professionals on utilizing BI data stored in SQL Server databases. Both a hands-on tutorial and a thorough reference, &lt;b&gt;SharePoint 2010 BI Unleashed&lt;/b&gt; will be an indispensable resource for every BI developer, implementer, manager, or integrator working with Microsoft technologies. “&lt;/p&gt;  &lt;p&gt;If looking for help on how to integrate the BI stack into your SharePoint 2010 environment, this book provides a thorough reference to the applications listed above as well as provides real world step by step examples on how to integrate several of the BI components to build a complete BI solution.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-8845576225823908238?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/8845576225823908238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=8845576225823908238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8845576225823908238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8845576225823908238'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/04/microsoft-sharepoint-2010-business.html' title='Microsoft SharePoint 2010 Business Intelligence Unleashed Book'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_Bb_dqfXVtDU/TbGRYY-pSFI/AAAAAAAAAGI/iBWmciJ6GsQ/s72-c/BI%20SharePoint%20Book%20Cover%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6155115152659907971</id><published>2011-01-13T20:28:00.009-05:00</published><updated>2011-01-13T20:38:23.484-05:00</updated><title type='text'>Setup up a SQL Server 2008 R2 cluster using Virtual Machines</title><content type='html'>Sometimes, SQL Server Professionals need to practice setting up a SQL Server 2008 R2 Cluster on their local machines to gain some experience before setting it up for real in Staging or Production environments. In the past, this used to be virtually impossible without specific hardware such as a Storage Area Network (SAN) which is typically used for hosting the Shared Disks. However, with the release of Windows Storage Server 2008 and Windows Storage Server 2008 R2, it’s become much easier to do so using Virtual Machines. Please note that the following configuration is NOT recommended for a real-world Production environment. This configuration should only be used for a Development environment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 318px; DISPLAY: block; HEIGHT: 400px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5561847952532804290" border="0" alt="" src="http://3.bp.blogspot.com/_4r_6YJ84fRg/TS-nPrFzksI/AAAAAAAAABQ/UGltNN299mQ/s400/Cluster.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following are the steps on how to go about it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Setup 3 Virtual Machines running Windows Server 2008 R2 with 2 NICs on each of them. You can use either VMWare Player or Virtual Box. Configure the 1st NIC with a dynamic IP Address that will be used to connect to the host machine. Configure the 2nd NIC with a static IP Address that will be used by the 3 Servers to talk to each other. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Configure the 1st server as your Active Directory Domain Controller. You can call it MainServer.contoso.net.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Add the 2nd and 3rd servers to the Active Directory created on the 1st server. You can call them SQLServer1.contoso.net and SQLServer2.contoso.net respectively.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Configure MainServer.contoso.net as the Storage Server that will host the Shared Disks. You will need to install the iSCSI Target 3.3 software that can be found in the ISO image of Windows Storage Server 2008 R2. For more information on how to install it, please refer to: &lt;a href="http://blogs.technet.com/b/josebda/archive/2010/09/27/windows-storage-server-2008-r2-and-the-microsoft-iscsi-software-target-3-3-are-available-on-msdn-technet-here-s-how-to-install-them.aspx"&gt;http://blogs.technet.com/b/josebda/archive/2010/09/27/windows-storage-server-2008-r2-and-the-microsoft-iscsi-software-target-3-3-are-available-on-msdn-technet-here-s-how-to-install-them.aspx&lt;/a&gt;. NOTE: You ONLY need the iSCSI Target software. You do NOT need to install all the other bits for Windows Storage Server 2008 R2.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Configure the iSCSI Target and 2 Shared Disks on MainServer.contoso.net i.e. 1 for the quorum and the other for SQL Server data. This blog gives excellent step-by-step instructions on how to do so: &lt;a href="http://mohsartawi.wordpress.com/2010/05/25/implementing-a-virtual-machine-failover-cluster-with-windows-storage-server-2008/"&gt;http://mohsartawi.wordpress.com/2010/05/25/implementing-a-virtual-machine-failover-cluster-with-windows-storage-server-2008/&lt;/a&gt;. Even though it talks about Windows Storage Server 2008 (not R2), the steps are very similar.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Create a Service Account in Active Directory such as SQLService which will be used to run the SQL Server instances on both the servers.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Run the SQL Server setup on SQLServer1.contoso.net and choose the option “New SQL Server failover cluster installation”. Use a generic name such as SQLServer.contoso.net for the SQL Cluster.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Run the SQL Server setup on SQLServer2.contoso.net and choose the option “Add node to a SQL Server failover cluster”.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Create a sample database on SQLServer1 but connect to it from your host machine using SQLServer.contoso.net. Shut down SQLServer1. You should still be able to access the database because SQLServer2 will take over. &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6155115152659907971?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6155115152659907971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6155115152659907971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6155115152659907971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6155115152659907971'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2011/01/setup-up-sql-server-2008-r2-cluster.html' title='Setup up a SQL Server 2008 R2 cluster using Virtual Machines'/><author><name>Deepak Gupta</name><uri>http://www.blogger.com/profile/07751973084135910957</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_4r_6YJ84fRg/TS-nPrFzksI/AAAAAAAAABQ/UGltNN299mQ/s72-c/Cluster.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6760811518305700401</id><published>2010-11-04T09:04:00.014-04:00</published><updated>2010-11-04T11:25:42.558-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='report export'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS 2005'/><title type='text'>SSRS report parameter to show or hide columns</title><content type='html'>Sometimes reports are used mostly for data analysis, rather than presentation. In such cases users request many filtering options and flexibility in choosing the data included in a report. So frequently they ask to select which report columns to show.&lt;br /&gt;&lt;br /&gt;When resulting data set is large it may be better to filter the data in the query or stored procedure and return only the columns user requests. However, there is a simple way to let a user show or hide many columns. All the column selections can be included as one additional report parameter.&lt;br /&gt;&lt;br /&gt;Suppose a tabular report lists a number of projects with several details. There are about 20 columns, such as project name, employee contact information, project address, etc. Let's say users want ability to hide most of the columns.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Bh5FeAzGavE/TNK2ahzrNMI/AAAAAAAAAB8/jWtZ0TM_0SM/s1600/projectlist.jpg"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 500px; DISPLAY: block; HEIGHT: 125px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5535687458859726018" border="0" alt="" src="http://2.bp.blogspot.com/_Bh5FeAzGavE/TNK2ahzrNMI/AAAAAAAAAB8/jWtZ0TM_0SM/s400/projectlist.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;To give users such ability add a multi-valued parameter to the report that lists all the columns that users can hide. The parameter values are "non-queried" and correspond to the column names. By default the report shows all columns, so all possible parameter values are also included in the default list.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Bh5FeAzGavE/TNK5vkn4qeI/AAAAAAAAACM/NjvZMq7qvO0/s1600/parametervalues.jpg"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 500px; DISPLAY: block; HEIGHT: 350px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5535691118927718882" border="0" alt="" src="http://3.bp.blogspot.com/_Bh5FeAzGavE/TNK5vkn4qeI/AAAAAAAAACM/NjvZMq7qvO0/s400/parametervalues.jpg" /&gt;&lt;/a&gt;In report design select a column that users can hide and find and expand Visibility property of that column. If the Hidden attribute of Visibility property is true, the column is not shown in the resulting report. Set the value of the Hidden attribute to the following expression:&lt;br /&gt;&lt;p&gt;=NOT Join(Parameters!p_columns.Value).Contains("COLUMNVALUE&lt;column&gt;")&lt;/p&gt;&lt;p&gt;The COLUMNVALUE &lt;column&gt;must match the value of the parameter that identifies the selected column, such as "projectname", "address", etc. The Join function combines all possible parameter values into a single string. Then Contains function tests whether the user has checked that particular value in the list. The negation of expression tells Reporting Services to hide the column if the user has not checked its value in the parameter list. Set the Hidden property to such expression for every column you want to be able to hide.&lt;/p&gt;&lt;p&gt;One note of caution about using this approach with SSRS 2005. Due to the way SSRS 2005 text renderer works, the exported file does not include any column that can be hidden. That affects CSV and XML export. If you export directly to Excel, all selected columns show and have values. SSRS 2008 R2 does not have such a problem: text formats include all columns regardless of visibility settings, and other formats include all columns selected by the parameter values.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6760811518305700401?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6760811518305700401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6760811518305700401' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6760811518305700401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6760811518305700401'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/11/ssrs-report-parameter-to-show-or-hide.html' title='SSRS report parameter to show or hide columns'/><author><name>Mark Meyerovich</name><uri>http://www.blogger.com/profile/12476784828041031092</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Bh5FeAzGavE/TNK2ahzrNMI/AAAAAAAAAB8/jWtZ0TM_0SM/s72-c/projectlist.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-779009122221405877</id><published>2010-07-21T07:38:00.003-04:00</published><updated>2010-07-21T07:57:23.866-04:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;&lt;span style="font-size:180%;"&gt;Processing an OLAP cube with a T-SQL Stored Procedure&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When processing cubes, you have a couple of different choices about how to process your cube. One method is use an SSIS package with Cube\Dimension Processing tasks.&lt;br /&gt;&lt;br /&gt;Another method to process your cube is to use a stored procedure.&lt;br /&gt;&lt;br /&gt;Below is a simple SQL Server stored procedure that you can call to process an OLAP cube using T-SQL.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Create Procedure ProcessCube&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;@Database varchar(100),&lt;br /&gt;&lt;br /&gt;@Cube varchar(100),&lt;br /&gt;&lt;br /&gt;@Partition varchar(100) = null, -- If NULL, process the entire Cube&lt;br /&gt;&lt;br /&gt;@Server varchar(100) = 'localhost'&lt;br /&gt;&lt;br /&gt;as&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* variables used to store object handles */&lt;br /&gt;&lt;br /&gt;declare @o_svr int, @o_db int, @o_cube int, @o_part int, @o_mds int&lt;br /&gt;&lt;br /&gt;declare @hr int&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* different cube processing options. This SP uses "default" */&lt;br /&gt;&lt;br /&gt;declare @PROCESS_DEFAULT int&lt;br /&gt;&lt;br /&gt;declare @PROCESS_FULL int&lt;br /&gt;&lt;br /&gt;declare @PROCESS_REFRESH_DATA int&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set @PROCESS_DEFAULT = 0&lt;br /&gt;&lt;br /&gt;set @PROCESS_FULL = 1&lt;br /&gt;&lt;br /&gt;set @PROCESS_REFRESH_DATA = 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- create a DSO.Server object:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OACreate 'DSO.Server', @o_svr out&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at create server:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_svr&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Connect to the server:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAMethod @o_svr, 'Connect', null, @Server&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at connect to server:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_svr&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Get the MDStores property from the Server:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_svr,'MDStores', @o_mds OUT&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get getting Server MDStores:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_svr&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Get the database from the MDStores:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_mds,'Item',@o_db OUT,@Database&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get database:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_mds&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- get the MDStores property from the database:&lt;br /&gt;&lt;br /&gt;exec sp_OADestroy @o_mds&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_db,'MDStores', @o_mds OUT&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get database MDStores:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_db&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- get the Cube from the MDStores&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_mds,'Item',@o_cube OUT, @Cube&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get Cube:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_mds&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if @Partition is null -- Process the entire Cube, not just a single partition&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAMethod @o_cube, 'Process', null, @PROCESS_DEFAULT&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at process Cube:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_cube&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;else -- just process the specified Partition&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;-- Get the MDStores property of the Cube:&lt;br /&gt;&lt;br /&gt;exec sp_OADestroy @o_mds&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_cube,'MDStores', @o_mds OUT&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get Cube MDStores:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_cube&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Get the partition to process:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAGetProperty @o_mds,'Item',@o_part OUT, @Partition&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at get Parition:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_mds&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Process the partition:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAMethod @o_part, 'Process', null, @PROCESS_DEFAULT&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at process Partition:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_part&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- And unlock all objects on the server:&lt;br /&gt;&lt;br /&gt;exec @hr = sp_OAMethod @o_svr, 'UnlockAllObjects'&lt;br /&gt;&lt;br /&gt;if @hr &lt;&gt; 0&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;print 'Error at unlock all server objects:'&lt;br /&gt;&lt;br /&gt;exec sp_OAGetErrorInfo @o_svr&lt;br /&gt;&lt;br /&gt;goto cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cleanup:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if @o_mds is not null exec sp_OADestroy @o_mds&lt;br /&gt;&lt;br /&gt;if @o_Part is not null exec sp_OADestroy @o_Part&lt;br /&gt;&lt;br /&gt;if @o_cube is not null exec sp_OADestroy @o_cube&lt;br /&gt;&lt;br /&gt;if @o_db is not null exec sp_OADestroy @o_db&lt;br /&gt;&lt;br /&gt;if @o_svr is not null exec sp_OADestroy @o_svr&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-779009122221405877?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/779009122221405877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=779009122221405877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/779009122221405877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/779009122221405877'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/07/processing-olap-cube-with-t-sql-stored.html' title=''/><author><name>Rich Cargile</name><uri>http://www.blogger.com/profile/15219630895270441765</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-9074263883264347344</id><published>2010-05-04T10:47:00.014-04:00</published><updated>2010-05-04T11:18:09.872-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 Policy Management Policies Factets Exporting Current State'/><title type='text'>SQL Server 2008 Policy Management:  Defining and Exporting your ‘Golden’ Database State</title><content type='html'>Policy Management under SQL Server 2008 allows you to define settings for the properties of target objects that control the behavior or characteristics of those objects. One such managed target is a database. Once defined, these polices can then be enforced across all SQL Instances in your enterprise.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this blog we’ll see how one can create a ‘golden’ copy of a production database with all of the properties set to specific agreed-upon values and then export the current state of this database as a policy. This is a very nice shortcut for creating policies perhaps based on a template and can be a real time saver. It’s like a having a way of saying – “All production databases across our enterprise must look and behave like this database template. Also, if a production database is created without adhering to this policy we need to know!”&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Database Facet&lt;/strong&gt;&lt;br /&gt;Facets provide us with the properties that model the behavior or characteristics of a managed target. For a database, there are about 60 properties. Facets provide us with a single view of all properties which for the database facet include Name, Collation, Compatibility level, Auto Close, Encryption Enabled, Log and data File Location, etc. Interestingly, most literature dealing with Policy Management designates the feature's start-point in Management Studio as being Management --&gt; Policy Management --&gt; Policies. However, you are able to access the facet dialog from the database context menu by choosing the Facets menu item. (right click on a database and choose the facet menu option) The screen shot below displays the facet dialog for the MaketingLeads database and shows us what properties are exposed by this facet:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_k60MffeGnb4/S-A0JuvCxkI/AAAAAAAAAFk/3iQx5Lcg70U/s1600/DB+Facets.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5467427289396594242" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 360px" alt="" src="http://3.bp.blogspot.com/_k60MffeGnb4/S-A0JuvCxkI/AAAAAAAAAFk/3iQx5Lcg70U/s400/DB+Facets.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notice there are numerous properties than can be fine-tuned . (Many of these same properties are exposed and can be changed from the Options Tab present under database properties window) Also, notice the Export Current State as Policy button in this screen snapshot. This is the specific feature that allows you to take a snapshot of the current state and save the behavorial characterstics under the protective umbrella of a single policy. The Export as Policy dialog box is captured below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_k60MffeGnb4/S-A0YCDHEKI/AAAAAAAAAFs/RzzvhKco4xg/s1600/ExportAsPolicy.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5467427535099203746" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 173px" alt="" src="http://2.bp.blogspot.com/_k60MffeGnb4/S-A0YCDHEKI/AAAAAAAAAFs/RzzvhKco4xg/s400/ExportAsPolicy.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In conclusion, exporting the current state can be a quick and easy method for creating policies that monitor any changes from an original state. Consider including in your production database ‘golden copy’ conditions that enforce the well-known Microsoft Database Best Practices such as the Data and Log files must reside on different drives. Further, you may consider supplementing these with your own internal organization specific best practices. You may also consider creating other production templates that leverage other facets. For example -- a 'Production Lockdown' policy can be created that is based on settings made against properties exposed within the Surface Area facet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-9074263883264347344?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/9074263883264347344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=9074263883264347344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9074263883264347344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9074263883264347344'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/05/sql-server-2008-policy-management.html' title='SQL Server 2008 Policy Management:  Defining and Exporting your ‘Golden’ Database State'/><author><name>JoeToscano</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_k60MffeGnb4/S-A0JuvCxkI/AAAAAAAAAFk/3iQx5Lcg70U/s72-c/DB+Facets.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4790770973023795951</id><published>2010-04-30T14:06:00.017-04:00</published><updated>2010-04-30T17:27:08.630-04:00</updated><title type='text'>What's New in SSRS 2008 R2 Data Visualization</title><content type='html'>&lt;div&gt;&lt;span style="font-family:arial;"&gt;SQL Server Reporting Services (SSRS) 2008 R2 provides three new ways to visualize data in reports: maps, sparklines and data bars, and indicators.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Maps&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;Report Designer provides a Map Wizard and Map Layer Wizard to add maps and map layers to your report to help visualize data against a geographic background. You can add labels, legends, titles, a color scale, and a distance scale to help your users interpret the map display. You can add interactive features such as tooltips and drillthrough links, or provide parameters that enable a user to interactively control the visibility of each layer. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Sparklines and Data Bars&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Sparklines and data bars are simple charts that convey a lot of information in a little space, often inline with text. Sparklines and data bars are often used in tables and matrices. Their impact comes from viewing many of them together and being able to quickly compare them, instead of viewing them singly. This makes it easy to see the outliers. Sparklines and data bars have the same basic chart elements of categories, series, and values, but they have no legend, axis lines, labels, or tick marks.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Indicators&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Indicators are minimal gauges that convey the state of a single data value at a glance. The icons that represent indicators and their states are visually effective, even when they are used in small sizes. Indicators can show trends by using directional images such as arrows; ratings by using incremental icons such as stars; and states by using images such as traffic lights or check marks. &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/__RkG8rOS6tU/S9tKjJUHPKI/AAAAAAAACO8/VsUuTaEXtg0/s1600/image.jpg"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; FLOAT: left; HEIGHT: 224px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5466044540400385186" border="0" alt="" src="http://1.bp.blogspot.com/__RkG8rOS6tU/S9tKjJUHPKI/AAAAAAAACO8/VsUuTaEXtg0/s320/image.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;Click image to enlarge&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/__RkG8rOS6tU/S9sucLzpaAI/AAAAAAAACOc/JOOTRdvlPnY/s1600/Ind1.jpg"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4790770973023795951?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4790770973023795951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4790770973023795951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4790770973023795951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4790770973023795951'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/04/whats-new-in-ssrs-2008-r2-data.html' title='What&apos;s New in SSRS 2008 R2 Data Visualization'/><author><name>Aneel Ismaily</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/__RkG8rOS6tU/S6OBv50pycI/AAAAAAAACNA/ThL59_tHAQU/S220/IsmailyAneel.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/__RkG8rOS6tU/S9tKjJUHPKI/AAAAAAAACO8/VsUuTaEXtg0/s72-c/image.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-9179808714386969710</id><published>2010-04-18T16:38:00.000-04:00</published><updated>2010-04-18T20:11:47.082-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Filestream'/><category scheme='http://www.blogger.com/atom/ns#' term='BLOB'/><category scheme='http://www.blogger.com/atom/ns#' term='Best Practice'/><title type='text'>Key points on using Filestream attribute</title><content type='html'>According to this &lt;a href="http://research.microsoft.com/apps/pubs/default.aspx?id=64525"&gt;study from Microsoft Research&lt;/a&gt;, SQL Server handles BLOBs smaller than 256KB more efficiently than a file system, while NTFS is more efficient for BLOBS larger than 1MB. SQL Server 2008 introduced the Filestream storage attribute for varbinary(max) data type to store data in files.&lt;br /&gt;&lt;br /&gt;Here are the steps to begin using this feature:&lt;br /&gt;&lt;li&gt;Enable Filestream storage at an operating system level using SQL Server Configuration Manager (system administrator). Then enable it on a SQL Server instance level using sp_configure (database administrator). See specific steps &lt;a href="http://msdn.microsoft.com/en-us/library/cc645923.aspx"&gt;here&lt;/a&gt; or &lt;a href="http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/03/filestream-configuration-and-setup-changes-in-sql-server-2008-february-ctp.aspx"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb522469.aspx"&gt;Define a database filegroup&lt;/a&gt; that ties an NTFS file system location to a SQL Server database. It must be a local file system location.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add a &lt;a href="http://msdn.microsoft.com/en-us/library/ms188362.aspx"&gt;varbinary(max)&lt;/a&gt; column to a table definition with the FILESTREAM property. Add a &lt;a href="http://msdn.microsoft.com/en-us/library/ms187942.aspx"&gt;uniqueidentifier&lt;/a&gt; column with the ROWGUIDCOL property (required).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Read and write the data through the stream-based APIs to get the performance advantage attributed to the Filestream property. In .NET 3.5 SP1 such support is provided by the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqlfilestream.aspx"&gt;SqlFileStream class.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;Example of column definitions:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  Photo VARBINARY(max) FILESTREAM NULL,&lt;br /&gt;  RowId UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL UNIQUE DEFAULT NEWID()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Reference:&lt;br /&gt;Bob Beauchemin, &lt;a href="http://msdn.microsoft.com/en-us/magazine/dd695918.aspx"&gt;Programming with FileStreams in SQL Server 2008&lt;/a&gt;, MSDN Magazine&lt;/li&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms187942.aspx"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-9179808714386969710?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/9179808714386969710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=9179808714386969710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9179808714386969710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9179808714386969710'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/04/key-points-on-using-filestream.html' title='Key points on using Filestream attribute'/><author><name>Mark Meyerovich</name><uri>http://www.blogger.com/profile/12476784828041031092</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5545936608069789560</id><published>2010-04-12T16:42:00.001-04:00</published><updated>2010-04-12T16:42:35.549-04:00</updated><title type='text'>SQL Server 2008 R2 Training Kit</title><content type='html'>&lt;p&gt;While attending the Philly .NET Code Camp this past Saturday, one of the presentations was around an overview of the SQL 2008 R2 features. From the presentation, I learned that Microsoft is making the new R2 features available through a download that you can configure locally onto a VPC. The training kit will assist you in learning the product as it provides demonstrations, hands on labs, and videos in the kit itself.&lt;/p&gt;  &lt;p&gt;The Training Kit can be found on the Microsoft Download Center at the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=fffaad6a-0153-4d41-b289-a3ed1d637c0d"&gt;SQL Server 2008 R2 Update for Developers Training Kit&lt;/a&gt; page&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5545936608069789560?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5545936608069789560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5545936608069789560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5545936608069789560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5545936608069789560'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/04/sql-server-2008-r2-training-kit.html' title='SQL Server 2008 R2 Training Kit'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-3612954047788814237</id><published>2010-03-22T17:44:00.002-04:00</published><updated>2010-03-22T21:59:47.951-04:00</updated><title type='text'>All up BI Demo – Release 9.2</title><content type='html'>Microsoft has developed a comprehensive &lt;strong&gt;Business Intelligence solution demo (version 9.2)&lt;/strong&gt; using SQL Server 2008 R2, Microsoft Office 2010 and SharePoint 2010 technology. This solution enables Business Intelligence for everyone at Contoso (fictional company created by Microsoft) through familiar tools, self–service capabilities, and access to critical business information.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Dan, the CEO of Contoso&lt;/strong&gt;, is able to get a quick view of his company’s overall performance with scorecards from PerformancePoint services, quickly isolate trouble spots using a custom-built Silverlight application integrated with SQL Server Analysis Services and Bing Maps, and to facilitate a company-wide collaborative initiative to help direct future decision-making using SharePoint 2010.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Toni, the Chief Marketing Officer&lt;/strong&gt; uses SharePoint 2010 solutions to go behind the numbers to gain insights into the performance of Contoso product sales. With PerformancePoint Services scorecards and dashboards, as well as Reporting Services reports and aggregated SharePoint lists, she is able to perform quick analysis and uncover useful intelligence in fewer clicks. With immediate access to company-wide people and knowledge, she quickly discovers new information about regional marketing strategies that empowers her to make smarter business choices.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Richard, a marketing analyst for Contoso&lt;/strong&gt;, takes advantage of the self-service analysis tools available from Microsoft to turn data into useful business intelligence. With PowerPivot for Excel and SharePoint, he brings data from several sources to create new comparisons that wouldn’t have been possible before and then publishes these new worksheets to a secure online gallery for others in his company to use. Armed with his new insights, he generates a summary report for widespread distribution using Report Builder 3.0 and makes solid recommendations to benefit the upcoming product plan. Even while Richard performs his own self-service analysis, the Contoso IT department is able to monitor and manage the resources needed to support the online PowerPivot Gallery and the workbooks contained there.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:180%;"&gt;Key Features:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;• SharePoint 2010 Insights, PerformancePoint Services, Excel Services, Visio Services, Reporting Services, Search, Social Relevance, Communities, Team Sites, People Profiles, Blogs, Organizational Browser, Workflows&lt;br /&gt;• Silverlight, integrated with Bing Maps for the Enterprise and SQL Server Analysis Services&lt;br /&gt;• Office 2010 Web Applications, Excel Co-editing&lt;br /&gt;• PowerPivot for SharePoint, Excel&lt;br /&gt;• PowerPivot Management Dashboard&lt;br /&gt;• Report Builder 3.0&lt;br /&gt;• SQL Server 2008 R2 DB Engine&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:180%;"&gt;How to access “All up BI Demo 9.2”:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;There are two ways to access this demo solution, online remote access to server configured by Microsoft or via configuring virtual machine locally.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Online Solution:&lt;/strong&gt;&lt;/em&gt; Microsoft has configured a remote server for general public to get hands on experience with this new BI version 9.2 solution;&lt;br /&gt;a. Type following url in your internet explorer, http://fs.mssalesdemos.com/&lt;br /&gt;b. Sign in with Windows Live id, create one if you do not have one already&lt;br /&gt;c. Click on “Catalog” from top menu&lt;br /&gt;d. Select “All up BI Demo – Release 9.2” from the list and select hours you want to spend with this solution (right side of the screen) and click start. Application will take few minutes to load the actual machine for you at the bottom.&lt;br /&gt;e. While application prepares the machine for you, you can download the demo script from the main page. You will use this script to get the hands on experience with this solution. You also need to enable ActiveX in your browser for this solution to work.&lt;br /&gt;f. Once machine loads at the bottom of the page, double click on it and it will start the remote session. Sometimes you have to try couple of times to connect.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Virtual Machine Configuration:&lt;/em&gt;&lt;/strong&gt; Second option is to download the VM file from Microsoft Partner’s website. It comes as 42 individual files which you need to extract to get your final 80GB virtual machine file. It was not practical for me to configure this on my local machine because my local machine was not able to meet the requirements. I have listed suggested requirements below from Microsoft;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;em&gt;Requirements:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;• Server 2008 R2 RTM with Hyper-V&lt;br /&gt;• 200 GB Free Hard Drive space (High performance disks Preferred)&lt;br /&gt;• Dual Core processor VT enabled&lt;br /&gt;• 8 GB RAM&lt;br /&gt;• Internet Connection&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-3612954047788814237?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/3612954047788814237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=3612954047788814237' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3612954047788814237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3612954047788814237'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/03/all-up-bi-demo-release-92.html' title='All up BI Demo – Release 9.2'/><author><name>Aneel Ismaily</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/__RkG8rOS6tU/S6OBv50pycI/AAAAAAAACNA/ThL59_tHAQU/S220/IsmailyAneel.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-2587409262730056747</id><published>2010-02-22T20:26:00.016-05:00</published><updated>2010-02-22T21:47:40.705-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS Extract Dynamic Data Driven Package Variables Expressions'/><title type='text'>SSIS Table Driven Package Configurations with Row Level Filtering</title><content type='html'>&lt;strong&gt;SSIS Table Driven Package Configurations with Row Level Filtering&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Recently we faced a challenge in which we wanted to implement SSIS table-driven package configurations with a twist. We wanted to have a common or shared SSIS package configuration table and have the packages that make up our solution dynamically filter or utilize only specific package configuration rows from this table based on a package variable value. For example – let’s assume our package variable is the customer name with a sample value of: ‘ToscanosHardware.’ What we like to do is to have our SSIS packages look in the User::str_customer_name package variable for the customer-to-process, and then only utilize package configuration rows that apply to this specific customer. (there is a configuration filter column in the SSIS package configuration table) In other words, we’d like to implement table driven package configurations with row level filtering based on a package variable value.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why can’t we do this with standard package configurations?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Given the current way in which table based package configurations work, we couldn’t find a way to implement row level filtering based on a package variable. Let’s assume we setup standard table based package configuration that use the following table:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;CREATE TABLE [dbo].[SSIS Configurations]&lt;br /&gt;( ConfigurationFilter NVARCHAR(255) NOT NULL,&lt;br /&gt;ConfiguredValue NVARCHAR(255) NULL,&lt;br /&gt;PackagePath NVARCHAR(255) NOT NULL,&lt;br /&gt;ConfiguredValueType NVARCHAR(20) NOT NULL)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;When, you create a package configuration entry in this table, you are asked to provide a ConfigurationFilter value. Here’s where we’d like very much to use an SSIS Expression and tell SSIS to filter based on what that expression evaluation to! Wouldn’t it be great to be able to provide a filter value that uses a package variable as part of an expression? This does not seem to work because what filter value we provide is actually literally interpreted.&lt;br /&gt;What we’d like to do is capture in the provided screen snapshot:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_k60MffeGnb4/S4MvA3dG9kI/AAAAAAAAAEs/QpO_yqmjS-I/s1600-h/Package+Configuration+wizard.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5441244466726237762" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 340px" alt="" src="http://3.bp.blogspot.com/_k60MffeGnb4/S4MvA3dG9kI/AAAAAAAAAEs/QpO_yqmjS-I/s400/Package+Configuration+wizard.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;---- Here's what we tried!&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notice for the Configuration filter value we provide. We attempt to provide a SSIS expression here. However, the value we provide: User::customer_name + '_Stage_Connection' is not evaluated but is instead literally interpreted.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Custom SSIS Solution&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;We ended up creating our own custom SSIS table-driven solution that was both straight-forward and easy to implmenent. Our custom SSIS solution requires several package variables along with SSIS tasks that reference a custom package configuration table that has the same column layout as the standard package configurations, but we appropriately named our table: &lt;strong&gt;dbo.ssis_custom_configurations.&lt;/strong&gt; The SSIS tasks must be placed at the beginning of each package, so we placed them in the OnPreExecute Event Handler area.&lt;br /&gt;In the sections that follow we will dissect each of these components in details so you can fully understand how to implement this solution.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Package Variables&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are several variables that are required to drive the custom solution. These are in the table below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;str_customer_name&lt;/strong&gt;&lt;br /&gt;This package variable provides the customer name we wish to processs and is actually&lt;br /&gt;used to dynamically construct the ConnectString that points to the customer's Staging&lt;br /&gt;Database. For example -- if we have a customer of 'ToscanosHardware' our staging&lt;br /&gt;database will be ToscanosHardware_Stage.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;str_configured_object_name&lt;/strong&gt;&lt;br /&gt;What is the name of the object are we going to focus on? We've pointed to both Connections&lt;br /&gt;here and package variables. For example -- we have a generic Connection String we called&lt;br /&gt;&lt;em&gt;stage.oledb. &lt;/em&gt;Using our solution, this default catalog / database is changed leveraging the&lt;br /&gt;str_customer_name.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;str_configured_value&lt;/strong&gt;&lt;br /&gt;This package variable holds the new connection string value or packag variable value that&lt;br /&gt;is obtained from the custom table.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;str_config_filter&lt;/strong&gt;&lt;br /&gt;This package variable actually holds the value we are using as our row level filter. It is an&lt;br /&gt;expression that combines the package name along with the customer name. Here's the&lt;br /&gt;&lt;span style="color:#666666;"&gt;&lt;span style="color:#000000;"&gt;expression: &lt;/span&gt;&lt;em&gt;@[System::PackageName]+"_"+ @[User::str_customer_cd]&lt;/em&gt;&lt;/span&gt; A sample&lt;br /&gt;value could be '&lt;span style="color:#000000;"&gt;extract_customer_data_ToscanosHardware'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rs_config&lt;/strong&gt;&lt;br /&gt;Hold the full result set (the rows returned from the package configuration table that whose&lt;br /&gt;filter_name matches the str_config_filter package variable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Required SSIS Tasks&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SSIS tasks below must be copied to the beginning of each package that you wish to participate in the custom package configurations solution. The tasks are below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/S4M4eWAe3RI/AAAAAAAAAE8/4rZ8dDMmJcw/s1600-h/Required+SSIS+Tasks.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5441254868748524818" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 196px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/S4M4eWAe3RI/AAAAAAAAAE8/4rZ8dDMmJcw/s400/Required+SSIS+Tasks.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.1 The GET CONFIG VALUES Execute SQL Task&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The EXEC SQL Statement selects all rows from the custom package configuration table&lt;br /&gt;using the str_config_filter in the where clause. Let’s assume we are currently working in a&lt;br /&gt;package that extracts sales details data for the ‘ToscanosHardware’ customer. In this case,&lt;br /&gt;our SSIS package name is ‘ext_sales_details’ so our str_config_filter is&lt;br /&gt;‘ext_sales_details_ToscanosHardware’ The actual select statement used by the Execute&lt;br /&gt;SQL Task is below followed by a screen snapshot of the actual task:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;SELECT&lt;br /&gt;configured_object_name,&lt;br /&gt;property_name,&lt;br /&gt;configured_value&lt;br /&gt;FROM&lt;br /&gt;ssis_configurations&lt;br /&gt;WHERE&lt;br /&gt;filter_name = ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The select statement maps the User::str_config_filter package variable to the parameter.&lt;br /&gt;Also, the User::rs_config package variable holds the full result set allowing a For Each SSIS&lt;br /&gt;container to be used.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_k60MffeGnb4/S4M6dO0OVKI/AAAAAAAAAFE/pEYMEVDGOfI/s1600-h/EXEC+SQL+GET+CONFIG+VALUES.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5441257048661447842" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 329px" alt="" src="http://4.bp.blogspot.com/_k60MffeGnb4/S4M6dO0OVKI/AAAAAAAAAFE/pEYMEVDGOfI/s400/EXEC+SQL+GET+CONFIG+VALUES.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;2.2 The For Each Container&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The For Each Container uses the output of the Execute SQL Task which is a result set from&lt;br /&gt;the custom package configuration table. The Collection Tab specifies the Users::rs_config&lt;br /&gt;object source variable as seen below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, the columns returned are mapped to the following package variables as specified in&lt;br /&gt;the Variable Mappings tab:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/S4M75PE_D1I/AAAAAAAAAFU/4Q20rktrr6o/s1600-h/For+Each+Container.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5441258629279715154" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 382px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/S4M75PE_D1I/AAAAAAAAAFU/4Q20rktrr6o/s400/For+Each+Container.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Finally, the columns returned are mapped to the following package variables as specified in&lt;br /&gt;the Variable Mappings tab:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/S4M8yCujxxI/AAAAAAAAAFc/EBvPQ9gZ62E/s1600-h/For+Each+Loop+Editor.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5441259605216970514" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 382px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/S4M8yCujxxI/AAAAAAAAAFc/EBvPQ9gZ62E/s400/For+Each+Loop+Editor.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;2.3 SCR - SETUP CONFIGS Script Task&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Script Task uses the package variables set in the For Each loop and actually changes the values of either the Connection String or the Package Variable Values. It is up to you to add the rows between the Select Case and the End Select. In the example below, these rows reference the connection strings and/or package variables you wish to change via this custom solution. In the example script below we are changing the ConnectionString values for both the Stage.OLEDB connection and the Stage.ADONET connection. Also, we are changing the values of the str_product_input_filename_pattern and the str_input_feed_directory package variables. These connection string rows and package variable rows must exist in the package configuration table. &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Imports System&lt;br /&gt;Imports System.Data&lt;br /&gt;Imports System.Math&lt;br /&gt;Imports Microsoft.SqlServer.Dts.Runtime&lt;br /&gt;&lt;br /&gt;&lt;system.addin.addin("scriptmain",&gt;_&lt;br /&gt;&lt;system.clscompliantattribute(false)&gt;_&lt;br /&gt;Partial Public Class ScriptMain&lt;br /&gt;Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase&lt;br /&gt;&lt;br /&gt;Enum ScriptResults&lt;br /&gt;Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success&lt;br /&gt;Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure&lt;br /&gt;End Enum&lt;br /&gt;Public Sub Main()&lt;br /&gt;Try&lt;br /&gt;Select Case Dts.Variables("str_configured_object_name").Value.ToString&lt;br /&gt;Case "Stage.OLEDB"&lt;br /&gt;If Dts.Variables("str_property_name").Value.ToString = "ConnectionString" Then&lt;br /&gt;Dts.Connections("Stage.OLEDB").ConnectionString =&lt;br /&gt;Dts.Variables("str_configured_value").Value.ToString&lt;br /&gt;End If&lt;br /&gt;Case "Stage.ADONET"&lt;br /&gt;If Dts.Variables("str_property_name").Value.ToString = "ConnectionString" Then&lt;br /&gt;Dts.Connections("Stage.ADONET").ConnectionString =&lt;br /&gt;Dts.Variables("str_configured_value").Value.ToString&lt;br /&gt;End If&lt;br /&gt;Case "str_product_input_filename_pattern"&lt;br /&gt;If Dts.Variables("str_property_name").Value.ToString = "Value" Then&lt;br /&gt;Dts.Variables("str_product_input_filename_pattern").Value =&lt;br /&gt;Dts.Variables("str_configured_value").Value.ToString&lt;br /&gt;End If&lt;br /&gt;Case "str_input_feed_directory"&lt;br /&gt;If Dts.Variables("str_property_name").Value.ToString = "Value" Then&lt;br /&gt;Dts.Variables("str_input_feed_directory").Value =&lt;br /&gt;Dts.Variables("str_configured_value").Value.ToString&lt;br /&gt;End If&lt;br /&gt;End Select&lt;br /&gt;&lt;br /&gt;Dts.TaskResult = ScriptResults.Success&lt;br /&gt;Catch ex As Exception&lt;br /&gt;Debug.Print(ex.Message)&lt;br /&gt;Dts.TaskResult = ScriptResults.Failure&lt;br /&gt;End Try&lt;br /&gt;End SubEnd Class&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The custom SSIS solution worked like charm. We were able to actually pass the customer name as a parameter to the startup (master) package via a SQL Server Job. The master package that executed the children packages passed this customer name to the children via a Parent / Child package configuration. By doing this, we could have a generic SSIS solution that dynamically processed different customer data simply by having one job per customer.&lt;br /&gt;We also embedded the required SSIS tasks in the OnPreExecute and OnPostExecute Event Handler events. This way we didn’t have to clutter up each package. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-2587409262730056747?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/2587409262730056747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=2587409262730056747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2587409262730056747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2587409262730056747'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/02/ssis-table-driven-package.html' title='SSIS Table Driven Package Configurations with Row Level Filtering'/><author><name>JoeToscano</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_k60MffeGnb4/S4MvA3dG9kI/AAAAAAAAAEs/QpO_yqmjS-I/s72-c/Package+Configuration+wizard.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6974140947627166268</id><published>2010-02-19T16:45:00.004-05:00</published><updated>2010-02-19T16:57:01.222-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS configurations'/><title type='text'>Errors locating SSIS XML package configuration files.</title><content type='html'>&lt;span style="font-family:arial;"&gt;SSIS provides several ways to make a package configurable, including using database configurations, XML file configurations, and environment variables. Of the different methods, XML files are probably the simplest and most dynamic approaches. However, it can be frustrating to figure out why a package generates errors that “The configuration file cannot be found” or that it “Failed to load at least one of the configuration entries for the package.” Why can’t it locate the configuration file? The key is to understand how SSIS sets what I will call the ‘working folder’ (that’s my term, it’s not in SSIS anywhere).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Before discussing that, let me clarify the situation a bit. When you create an XML configuration file, if you specify the path to the file, then that path will be required on all development machines as well as the production machines. On a recent project, the client didn’t want to have a fixed path for the SSIS files, instead they wanted the packages to accept configuration from wherever the package files were located. So, by design we did NOT specify a folder location for the configuration files. Instead, we simply specified the file name so that the configuration file would ‘live’ in the same folder as package. This worked fine, however it revealed an unexpected behavior of SSIS – this notion of a ‘working folder’.&lt;br /&gt;&lt;br /&gt;Question: What determines where SSIS will look for its files? Well, that depends on how you opened your project. Some people launch BIDS from the Start menu and then select the project from the ‘Recent Projects’ list or choose ‘File – Open -- Project/Solution’. If you use either of those methods, then the ‘working directory’ will be wherever the BIDS executables reside, most likely something like ‘C:\Program Files\Microsoft Visual Studio 8\Common7\IDE’. I’m guessing that this is NOT where you put your configuration files, so as a result, when you open a package, you get an error message that the configuration files can’t be found. There’s really a simple solution to this and it is to 1) locate your configuration files (dtsconfig files) in the same directory as your solution file (.sln file), and then to 2) ALWAYS open your solution by double-clicking the solution file (.sln file). This will set the ‘working folder’ to be where the solution lives, your configuration file will be read correctly, and the errors about not finding the configuration should be gone.&lt;br /&gt;&lt;br /&gt;Now, that works fine when you are developing, because you are specifying where the files open from, but what about production? How do you specify the ‘working folder’ when scheduling the packages using SQL Agent? Well, we ran into that situation as well, and sure enough when SQL Agent tries to execute a package, its ‘working folder’ defaults to the location of the DTEXEC executable. So, a simple workaround was to create a batch file that first changes to the directory where the packages and configuration files live, and then execute DTEXEC with the command line options that we wanted. Then, in SQL Agent, instead of using the ‘SQL Server Integration Services package’ type job, use an ‘Operating System (CmdExec)’ type job and just call the batch file. Worked like a charm. If the location of the packages ever needs to change to a different folder, drive, or even server, it’s a simple change to the batch file to reference that new location.&lt;br /&gt;&lt;br /&gt;In closing, having a fixed configuration location or using an environment variable to hard-code the location of configuration files would avoid this situation, but places requirements on server configuration and directory structure. SSIS can support completely dynamic configuration file location, but you need to be aware of how it sets its ‘working folder’.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6974140947627166268?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6974140947627166268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6974140947627166268' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6974140947627166268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6974140947627166268'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/02/errors-locating-ssis-xml-package.html' title='Errors locating SSIS XML package configuration files.'/><author><name>Jim Pletscher</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5870202106576907542</id><published>2010-02-01T15:17:00.001-05:00</published><updated>2010-02-01T15:17:13.273-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Analysis Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Integrated Mode'/><category scheme='http://www.blogger.com/atom/ns#' term='ASSPIInstallFarmAction'/><title type='text'>Creating a SharePoint 2010 Business Intelligence VM Image (using SQL Server 2008 R2 CTP)</title><content type='html'>&lt;strong&gt;&lt;span style="font-size: large;"&gt;Introduction&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SharePoint is becoming more and more prominent as the delivery mechanism for BI solutions within the Microsoft stack. The SharePoint 2010 BETA along with SQL Server 2008 R2 further strengthen the overall business intelligence capabilities and functionality possible in an organization.&lt;br /&gt;&lt;br /&gt;I have a VM image to ramp up on SharePoint 2010 itself but in order to expand into all of the new BI features I wanted to create a new one (from scratch) with the latest SQL Server 2008 R2 CTP. So I did! It was a&amp;nbsp;very tedious process but I found a guide to assist me.&lt;br /&gt;&lt;br /&gt;I used the wonderful instructions laid out here: &lt;a href="http://www.sharepointdevwiki.com/display/spadmin2010/Installing+SharePoint+2010+Public+Beta"&gt;http://www.sharepointdevwiki.com/display/spadmin2010/Installing+SharePoint+2010+Public+Beta&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, since I was using SQL Server 2008 R2 and wanted to configure it for full business intelligence usage, I needed to modify the steps slightly. This post will outline those steps and show any updated walkthroughs.&lt;br /&gt;&lt;br /&gt;These instructions/steps are&amp;nbsp;needed only when&amp;nbsp;using&amp;nbsp;SQL Server 2008 R2 CTP as there are several installation issues when integrating with SharePoint 2010. Hopefully in the release these will be corrected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Installation Steps&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1) Follow Steps 00, 0b, 0c and 01 from the SharePoint Dev Wiki guide&lt;br /&gt;&lt;br /&gt;2) Instead of step 02, we will install SQL Server 2008 R2 CTP but that comes later!&amp;nbsp;&lt;strong&gt;DO NOT&amp;nbsp;INSTALL SQL Server 2008 yet. &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;3) Steps 3-9 can now be skipped as everything there will be (or has been) installed with Windows Server 2008 R2, SQL 2008 R2, and SharePoint Pre-Reqs.&lt;br /&gt;&lt;br /&gt;4) Do not even look at Step 10 - skip to 10b and 10c. I happened to disregard the notes about using the Administrator account for everything and ran into an issue at the end. You may want to look at Step 15 and review the supporting links (as well as the supporting links within those pages). Key thing is to not setup that sp_admin account for this VM. &lt;br /&gt;&lt;br /&gt;Also, I decided after the fourth time to actually install the hotfix first (10c), reboot, then install the SharePoint Pre-Reqs (10b), and reboot again. Take the time now because if something fails you could waste hours or days going through the same steps again and again.&lt;br /&gt;&lt;br /&gt;5) Perform Step 11 - &lt;strong&gt;DO NOT RUN THE CONFIGURATION WIZARD - UNCHECK THE CHECKBOX. &lt;/strong&gt;Click on Close. The next step here will perform the rest of the configuration.&lt;br /&gt;&lt;br /&gt;6) Install SQL Server Analysis Services&amp;nbsp;Integration Mode - &lt;strong&gt;(see walkthrough below)&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;7) Perform Steps 13 and 14&lt;br /&gt;It does take a few minutes to start the User Profile service and to run the synchronization. I did not see anything in the Running Jobs (the first time but the second time I did). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8) Perform Step 15 - before you click on the User Profile Service Application, select it first by click to the right of the link. Then on the top ribbon, click on Administrators (see screens below). The Administrator account should be in there automatically but only the "Retrieve People Data..." permission is selected. I selected Full Control as the TechNet links from those supporting links discussed about the account having full control. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2LckQkNDGI/AAAAAAAAAP0/JshwoA2ldXE/s1600-h/User+Profile+Service+App+Admin+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2LckQkNDGI/AAAAAAAAAP0/JshwoA2ldXE/s640/User+Profile+Service+App+Admin+1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2LcpochXeI/AAAAAAAAAP8/j2TOkQnID_Y/s1600-h/User+Profile+Service+App+Admin+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2LcpochXeI/AAAAAAAAAP8/j2TOkQnID_Y/s400/User+Profile+Service+App+Admin+2.png" width="383" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I thought the Profile load was finished&amp;nbsp;and found 0 users&amp;nbsp;but it just took some time to complete. The status said it was done but apparently something was running in the background. &lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;9) Now go back to the SQL Server 2008 R2 installation and install&amp;nbsp;the&amp;nbsp;default instance with Reporting Services (Integrated) and Analysis Services (native). &lt;strong&gt;See walkthrough below.&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10)&amp;nbsp;Configure Reporting Services - Integrated Mode. &amp;nbsp;&lt;strong&gt;See walkthrough below.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;11) Optional: Install Visual Studio 2010&lt;br /&gt;&lt;br /&gt;12) Optional: Install Office 2010 BETA. Include the Visual Studio Tools for Office (VSTO).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;SQL Server 2008 R2 - Analysis Services Integrated Mode Installation and Configuration Walkthrough&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cA7wV6ThI/AAAAAAAAATE/tctZG_CpP3g/s1600-h/Configure+AS+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cA7wV6ThI/AAAAAAAAATE/tctZG_CpP3g/s400/Configure+AS+1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cA_sL8zkI/AAAAAAAAATM/x8Mnvw_q48c/s1600-h/configure+as+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cA_sL8zkI/AAAAAAAAATM/x8Mnvw_q48c/s400/configure+as+2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBD-Ag3lI/AAAAAAAAATU/sSq7bAj9mlA/s1600-h/configure+as+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBD-Ag3lI/AAAAAAAAATU/sSq7bAj9mlA/s400/configure+as+3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cBHm_Q9QI/AAAAAAAAATc/cLIYiBVAKls/s1600-h/configure+as+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cBHm_Q9QI/AAAAAAAAATc/cLIYiBVAKls/s400/configure+as+4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBK0t4NWI/AAAAAAAAATk/uf2WQvZRLIA/s1600-h/configure+as+5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBK0t4NWI/AAAAAAAAATk/uf2WQvZRLIA/s400/configure+as+5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBNkQCccI/AAAAAAAAATs/c7ZxKawaN94/s1600-h/configure+as+6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBNkQCccI/AAAAAAAAATs/c7ZxKawaN94/s400/configure+as+6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBRKlHkCI/AAAAAAAAAT0/r0FTJjp7OYk/s1600-h/configure+as+7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBRKlHkCI/AAAAAAAAAT0/r0FTJjp7OYk/s400/configure+as+7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBWMZLpsI/AAAAAAAAAT8/Td5wKF399n4/s1600-h/configure+as+8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cBWMZLpsI/AAAAAAAAAT8/Td5wKF399n4/s400/configure+as+8.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBZnWS8QI/AAAAAAAAAUE/7D9vdWK29XQ/s1600-h/configure+as+9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBZnWS8QI/AAAAAAAAAUE/7D9vdWK29XQ/s400/configure+as+9.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBfFMsaUI/AAAAAAAAAUM/OUrokEFSMnc/s1600-h/configure+as+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBfFMsaUI/AAAAAAAAAUM/OUrokEFSMnc/s400/configure+as+10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBiqxWmhI/AAAAAAAAAUU/ftpXWAQff0s/s1600-h/configure+as+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBiqxWmhI/AAAAAAAAAUU/ftpXWAQff0s/s400/configure+as+11.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cBojyDi8I/AAAAAAAAAUc/MJifujHiejo/s1600-h/configure+as+12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cBojyDi8I/AAAAAAAAAUc/MJifujHiejo/s400/configure+as+12.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBrpBGZBI/AAAAAAAAAUk/83HaNOSw-E4/s1600-h/configure+as+13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cBrpBGZBI/AAAAAAAAAUk/83HaNOSw-E4/s400/configure+as+13.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click the "Use the same account..." button and enter the Administrator credentials. Click OK.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cBxMimbsI/AAAAAAAAAUs/rEO2-CsygcE/s1600-h/configure+as+14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cBxMimbsI/AAAAAAAAAUs/rEO2-CsygcE/s400/configure+as+14.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cB2vghjEI/AAAAAAAAAU0/hUeKSpZBx_8/s1600-h/configure+as+15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cB2vghjEI/AAAAAAAAAU0/hUeKSpZBx_8/s400/configure+as+15.png" width="400" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cB7-I5huI/AAAAAAAAAU8/MSSw-rLyF7A/s1600-h/configure+as+16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cB7-I5huI/AAAAAAAAAU8/MSSw-rLyF7A/s400/configure+as+16.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click on "Add Current User". I was paranoid the "umpteenth" time and actually added the Local Service, Local System, and Network Service accounts in attempts to&amp;nbsp;prevent the time-out issue (the issue is described below).&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCDT0FsFI/AAAAAAAAAVE/kspQxxZs_vg/s1600-h/configure+as+17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCDT0FsFI/AAAAAAAAAVE/kspQxxZs_vg/s400/configure+as+17.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCHAAm0dI/AAAAAAAAAVM/BQ1yQPJO1sY/s1600-h/configure+as+18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCHAAm0dI/AAAAAAAAAVM/BQ1yQPJO1sY/s400/configure+as+18.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;VERY IMPORTANT!&lt;/strong&gt;&lt;br /&gt;Since this is a domain controller, a time out issue will occur as explained here: &lt;a href="http://powerpivotgeek.com/2009/11/17/installing-powerpivot-for-sharepoint-on-a-domain-controller/"&gt;http://powerpivotgeek.com/2009/11/17/installing-powerpivot-for-sharepoint-on-a-domain-controller/&lt;/a&gt;&lt;br /&gt;You need to monitor the services&amp;nbsp;in&amp;nbsp;Server Manager - Services &amp;nbsp;(while the installation is running) and change the SQL Server Analysis Services&amp;nbsp;(GeminiBI) Service back to the administrator account and make sure it is started. This needs to be corrected as soon as it happens. &lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cCK_4BytI/AAAAAAAAAVU/m-xuxiySyoQ/s1600-h/configure+as+19.png" imageanchor="1" style="clear: right; cssfloat: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cCK_4BytI/AAAAAAAAAVU/m-xuxiySyoQ/s400/configure+as+19.png" width="400" /&gt;&lt;/a&gt;You do have time however. The service won't even be listed until it gets installed. The switch occurs about midway through the &lt;strong&gt;ASSPIInstallFarmAction&lt;/strong&gt;. When the install is up to this point, you can see the service listed. I just kept hitting the Refresh and I did see it change eventually. Don't forget to Start the service after you change the Log On back to the Administrator account.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Click Install!&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cCPYdEHpI/AAAAAAAAAVc/hoO6M-fL4TE/s1600-h/configure+as+20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cCPYdEHpI/AAAAAAAAAVc/hoO6M-fL4TE/s400/configure+as+20.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;If this step does not complete successfully, you might as well delete the VM and start over.&lt;/strong&gt; It took me three days to get this right. Possible errors are: 1) timeout, 2) Object Not Set to Instance of an Object, and 3) Could not load or find assembly Microsoft.AnaysisServices.SharePoint.Integrated. There could be others but I wouldn't even bother trying to uninstall and re-install - I tried too many times only to find the best way was to just start over from scratch. Believe me, it will save you hours. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After completion. Go to Central Admin and click on the Configuration Wizards:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCk5WvQDI/AAAAAAAAAVk/eNT1UVjbkho/s1600-h/configure+as+21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cCk5WvQDI/AAAAAAAAAVk/eNT1UVjbkho/s400/configure+as+21.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Select the Farm Configuration.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cCzU6cmyI/AAAAAAAAAVs/C2K9jgrTUcI/s1600-h/configure+as+22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cCzU6cmyI/AAAAAAAAAVs/C2K9jgrTUcI/s400/configure+as+22.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click Next&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cC4x0GxDI/AAAAAAAAAV0/piI4wGfwYZs/s1600-h/configure+as+23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="352" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cC4x0GxDI/AAAAAAAAAV0/piI4wGfwYZs/s640/configure+as+23.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Use the Existing Managed Account and make sure the Administrator is selected. Click Next.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cDB2emCmI/AAAAAAAAAV8/ZCsLz13Uq0c/s1600-h/configure+as+24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cDB2emCmI/AAAAAAAAAV8/ZCsLz13Uq0c/s400/configure+as+24.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;This process already created a root site collection (I was a little upset about that). So we can skip this part. Click Skip.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cDTn0Us0I/AAAAAAAAAWM/NTjkjJvHDvk/s1600-h/configure+as+25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cDTn0Us0I/AAAAAAAAAWM/NTjkjJvHDvk/s400/configure+as+25.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click Finish! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;strong&gt;Default Instance - SQL Server 2008 R2 Installation Walkthrough (after Gemini Instance Install)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;(For Step&amp;nbsp;9 above)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cEgTjWLTI/AAAAAAAAAWU/EX9eBHYUe-o/s1600-h/Install+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cEgTjWLTI/AAAAAAAAAWU/EX9eBHYUe-o/s400/Install+1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cEjYT3vxI/AAAAAAAAAWc/Ai97ZuIJfKM/s1600-h/install+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cEjYT3vxI/AAAAAAAAAWc/Ai97ZuIJfKM/s400/install+2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cEmPSOD6I/AAAAAAAAAWk/U7CAEhq1ZLU/s1600-h/install+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cEmPSOD6I/AAAAAAAAAWk/U7CAEhq1ZLU/s400/install+3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cEoXkTajI/AAAAAAAAAWs/ZPkUsMu5qaE/s1600-h/install+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cEoXkTajI/AAAAAAAAAWs/ZPkUsMu5qaE/s400/install+4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cEv9aLuNI/AAAAAAAAAW8/zKf_aC_tZ6o/s1600-h/i6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cEv9aLuNI/AAAAAAAAAW8/zKf_aC_tZ6o/s400/i6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cEzaQiMlI/AAAAAAAAAXE/sGpxy4GPCe8/s1600-h/i7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cEzaQiMlI/AAAAAAAAAXE/sGpxy4GPCe8/s400/i7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cE2WQeEUI/AAAAAAAAAXM/Y3DgYOIjtz4/s1600-h/i8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cE2WQeEUI/AAAAAAAAAXM/Y3DgYOIjtz4/s400/i8.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cE5Vly_nI/AAAAAAAAAXU/UGWuK2uQm-E/s1600-h/i9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cE5Vly_nI/AAAAAAAAAXU/UGWuK2uQm-E/s400/i9.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Select All. Click Next.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cFgJLIYkI/AAAAAAAAAXs/qjan7Mgj6LY/s1600-h/i10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cFgJLIYkI/AAAAAAAAAXs/qjan7Mgj6LY/s400/i10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cFZmmN62I/AAAAAAAAAXk/JWPgGtwk30w/s1600-h/i11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cFZmmN62I/AAAAAAAAAXk/JWPgGtwk30w/s400/i11.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cFoyBLEwI/AAAAAAAAAX0/9GbxsFEo4V8/s1600-h/i12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cFoyBLEwI/AAAAAAAAAX0/9GbxsFEo4V8/s400/i12.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cFsQhcn7I/AAAAAAAAAX8/VxMv73loDvg/s1600-h/i13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cFsQhcn7I/AAAAAAAAAX8/VxMv73loDvg/s400/i13.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cFzG0hQ-I/AAAAAAAAAYE/FAayCth6Aeo/s1600-h/i14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cFzG0hQ-I/AAAAAAAAAYE/FAayCth6Aeo/s400/i14.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cF3WNfHiI/AAAAAAAAAYM/FDL31jXPUhs/s1600-h/i15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cF3WNfHiI/AAAAAAAAAYM/FDL31jXPUhs/s400/i15.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cF8uwR57I/AAAAAAAAAYU/u9-NeonVNXs/s1600-h/i16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cF8uwR57I/AAAAAAAAAYU/u9-NeonVNXs/s400/i16.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGAFLzCEI/AAAAAAAAAYc/y6oAFeiAGts/s1600-h/i17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGAFLzCEI/AAAAAAAAAYc/y6oAFeiAGts/s400/i17.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGDuGZH3I/AAAAAAAAAYk/-9b-2hzX9pw/s1600-h/i18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGDuGZH3I/AAAAAAAAAYk/-9b-2hzX9pw/s400/i18.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGHJgTHRI/AAAAAAAAAYs/zLqWG2YkeFo/s1600-h/i19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGHJgTHRI/AAAAAAAAAYs/zLqWG2YkeFo/s400/i19.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cGK4-XB7I/AAAAAAAAAY0/bBuomfJ6Zcs/s1600-h/i20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cGK4-XB7I/AAAAAAAAAY0/bBuomfJ6Zcs/s400/i20.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cGO6Ix_PI/AAAAAAAAAY8/J0zXI5l6Dt8/s1600-h/i21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cGO6Ix_PI/AAAAAAAAAY8/J0zXI5l6Dt8/s400/i21.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;SQL Server 2008 R2 - Reporting Services Configuration (Integrated Mode) Walkthrough&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;(For Step&amp;nbsp;10 above)&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cGXRfQeMI/AAAAAAAAAZE/_-tr7NjG4KE/s1600-h/Configure+RS+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cGXRfQeMI/AAAAAAAAAZE/_-tr7NjG4KE/s400/Configure+RS+1.png" width="355" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGe8KEPrI/AAAAAAAAAZM/8Wgl6LwivG4/s1600-h/Configure+RS+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGe8KEPrI/AAAAAAAAAZM/8Wgl6LwivG4/s400/Configure+RS+2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If you selected Integrated mode during installation, many of these settings are already in place. Go through each screen and make sure there is no warning symbol. Click Apply on the screens that show settings that haven't been set. The walkthrough may go through some additional details that aren't needed for your case. These mimic the configuration if a mode (native or integrated) was not selected.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGn_JM8nI/AAAAAAAAAZU/9XwnzQVhhWk/s1600-h/Configure+RS+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGn_JM8nI/AAAAAAAAAZU/9XwnzQVhhWk/s400/Configure+RS+4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cGs-fxMnI/AAAAAAAAAZc/xmI1idOB7u4/s1600-h/Configure+RS+5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cGs-fxMnI/AAAAAAAAAZc/xmI1idOB7u4/s400/Configure+RS+5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGwDBHJ0I/AAAAAAAAAZk/XqrLjMLS8HM/s1600-h/Configure+RS+6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGwDBHJ0I/AAAAAAAAAZk/XqrLjMLS8HM/s400/Configure+RS+6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGyw8srnI/AAAAAAAAAZs/cF35qI8LTBw/s1600-h/Configure+RS+7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cGyw8srnI/AAAAAAAAAZs/cF35qI8LTBw/s400/Configure+RS+7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If the database is not set, click on Change Database.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cG4NmySlI/AAAAAAAAAZ0/_V53VSsrzJE/s1600-h/Configure+RS+8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cG4NmySlI/AAAAAAAAAZ0/_V53VSsrzJE/s400/Configure+RS+8.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cHmj8SXHI/AAAAAAAAAZ8/I4r0VzLJ_W0/s1600-h/Configure+RS+9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cHmj8SXHI/AAAAAAAAAZ8/I4r0VzLJ_W0/s400/Configure+RS+9.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cHpi5VP2I/AAAAAAAAAaE/M8Z8jUD3xCk/s1600-h/Configure+RS+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cHpi5VP2I/AAAAAAAAAaE/M8Z8jUD3xCk/s400/Configure+RS+10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cHsHYPS9I/AAAAAAAAAaM/1KXBe1FPF3Y/s1600-h/Configure+RS+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cHsHYPS9I/AAAAAAAAAaM/1KXBe1FPF3Y/s400/Configure+RS+11.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cHu6wLtiI/AAAAAAAAAaU/1XBQosHWOI0/s1600-h/Configure+RS+12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cHu6wLtiI/AAAAAAAAAaU/1XBQosHWOI0/s400/Configure+RS+12.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cH5Xmqb5I/AAAAAAAAAak/O5bDofePYL4/s1600-h/Configure+RS+13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cH5Xmqb5I/AAAAAAAAAak/O5bDofePYL4/s400/Configure+RS+13.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cH8J7-zvI/AAAAAAAAAas/ql-qU9we5dA/s1600-h/Configure+RS+14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cH8J7-zvI/AAAAAAAAAas/ql-qU9we5dA/s400/Configure+RS+14.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cIAaWIdFI/AAAAAAAAAa0/LRTG0kCLsPo/s1600-h/Configure+RS+15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2cIAaWIdFI/AAAAAAAAAa0/LRTG0kCLsPo/s400/Configure+RS+15.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cIIm-m4dI/AAAAAAAAAa8/Wkky_82acv8/s1600-h/Configure+RS+16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cIIm-m4dI/AAAAAAAAAa8/Wkky_82acv8/s400/Configure+RS+16.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click Exit.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Download and run the Reporting Services Add-In for SharePoint 2010:&lt;/div&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=16bb10f9-3acc-4551-bacc-bdd266da1d45&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=16bb10f9-3acc-4551-bacc-bdd266da1d45&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cINDS6GCI/AAAAAAAAAbE/Ltx4X1QuJfY/s1600-h/Configure+RS+17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cINDS6GCI/AAAAAAAAAbE/Ltx4X1QuJfY/s320/Configure+RS+17.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cIiRo1SPI/AAAAAAAAAbM/mJ4aogSpjRE/s1600-h/Configure+RS+18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cIiRo1SPI/AAAAAAAAAbM/mJ4aogSpjRE/s320/Configure+RS+18.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cIlOaOcrI/AAAAAAAAAbU/OdYKxCYuDvQ/s1600-h/Configure+RS+19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cIlOaOcrI/AAAAAAAAAbU/OdYKxCYuDvQ/s320/Configure+RS+19.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cIoWbSHKI/AAAAAAAAAbc/9_iLCFa_Zgc/s1600-h/Configure+RS+20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cIoWbSHKI/AAAAAAAAAbc/9_iLCFa_Zgc/s320/Configure+RS+20.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cIq1bZJ0I/AAAAAAAAAbk/oe0PRzCbGXU/s1600-h/configure+rs+21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2cIq1bZJ0I/AAAAAAAAAbk/oe0PRzCbGXU/s320/configure+rs+21.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click Finish.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Go to Central Admin, and look under General Application Settings:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cIuvxdYEI/AAAAAAAAAbs/CIXaYRXmtlY/s1600-h/configure+rs+22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="218" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cIuvxdYEI/AAAAAAAAAbs/CIXaYRXmtlY/s400/configure+rs+22.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click on Reporting Services Integration.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cJCz8fRtI/AAAAAAAAAb0/SX5eD4E1Zhc/s1600-h/configure+rs+23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" kt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2cJCz8fRtI/AAAAAAAAAb0/SX5eD4E1Zhc/s400/configure+rs+23.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cJJi7Ra5I/AAAAAAAAAb8/i63zWsrDrPI/s1600-h/configure+rs+24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="226" kt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2cJJi7Ra5I/AAAAAAAAAb8/i63zWsrDrPI/s400/configure+rs+24.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Click Close.&lt;br /&gt;&amp;nbsp; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5870202106576907542?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5870202106576907542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5870202106576907542' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5870202106576907542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5870202106576907542'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/02/creating-sharepoint-2010-business.html' title='Creating a SharePoint 2010 Business Intelligence VM Image (using SQL Server 2008 R2 CTP)'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_gmYwAJepiK4/S2LckQkNDGI/AAAAAAAAAP0/JshwoA2ldXE/s72-c/User+Profile+Service+App+Admin+1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-1125244935834347285</id><published>2010-01-27T15:56:00.003-05:00</published><updated>2010-01-27T22:44:29.034-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Integrated Mode'/><title type='text'>SQL Server 2008 Reporting Services Integration with SharePoint 2010</title><content type='html'>I have been working with a Virtual Machine running SharePoint 2010. It has SQL Server 2008 Enterprise Edition but it did not have SSRS installed. I therefore downloaded the 64-Bit version of SQL Server Enterprise to install the extras.&lt;br /&gt;&lt;br /&gt;I went through the process and when I saw some options disabled I figured something was wrong:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2CQGzaPQ3I/AAAAAAAAAO8/gVbcugkvU3Y/s1600-h/SSRS+2008+in+SharePoint+2010+Install.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" mt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2CQGzaPQ3I/AAAAAAAAAO8/gVbcugkvU3Y/s640/SSRS+2008+in+SharePoint+2010+Install.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The SharePoint options were disabled. I couldn't select Native or Integrated mode here. I realized that it was looking for MOSS 2007. &lt;br /&gt;&lt;br /&gt;I therefore realized that SQL Server 2008 R2 probably has the SharePoint 2010 awareness. I immediately downloaded the SQL Server 2008 R2 Enterprise Evaluation and installed it on the VM. This time I was able to configure Reporting Services properly:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_gmYwAJepiK4/S2CVNHaI-3I/AAAAAAAAAPE/wGjaKQ9RN9A/s1600-h/SQL+Server+2008+R2+Install.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" mt="true" src="http://3.bp.blogspot.com/_gmYwAJepiK4/S2CVNHaI-3I/AAAAAAAAAPE/wGjaKQ9RN9A/s640/SQL+Server+2008+R2+Install.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gmYwAJepiK4/S2CVniP30zI/AAAAAAAAAPM/bKNmkhIBXYo/s1600-h/Report+Server+DB+Selection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="462" mt="true" src="http://4.bp.blogspot.com/_gmYwAJepiK4/S2CVniP30zI/AAAAAAAAAPM/bKNmkhIBXYo/s640/Report+Server+DB+Selection.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;After downloading and running through the installation of&amp;nbsp;SQL Server 2008 R2, I realized that the process for installing Reporting Services is essentially the same as before (with SQL Server 2008 making it a little easier than SQL Server 2005). This means that you still need to install the SharePoint Add-in as well.&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So what you need are both parts:&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;strong&gt;SQL Server 2008 R2 November CTP&lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx&lt;/a&gt;&lt;br /&gt;(I used the download from MSDN but it is publicly available using the above link)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL Server 2008 R2 RS Addin for SharePoint&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=16bb10f9-3acc-4551-bacc-bdd266da1d45&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=16bb10f9-3acc-4551-bacc-bdd266da1d45&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After you install the Add-In for Sharepoint, new options appear in Central Admin (just like in MOSS 2007):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClVePtRPI/AAAAAAAAAPU/qZppuXURF6s/s1600-h/Reporting+Services+in+Central+Admin.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="356" mt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClVePtRPI/AAAAAAAAAPU/qZppuXURF6s/s640/Reporting+Services+in+Central+Admin.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Clicking on the Reporting Services Integration allows you to complete the integration process:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClyoqYXYI/AAAAAAAAAPk/yhYYE88aXxw/s1600-h/Reporting+Services+Integration+Page+in+CA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="492" mt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClyoqYXYI/AAAAAAAAAPk/yhYYE88aXxw/s640/Reporting+Services+Integration+Page+in+CA.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;But it appears now can specify which site collections to deploy and activate the features. I had a few other site collections on the VM but under the /sites/ managed path. I am therefore thinking that it is really asking you to select the Root Site Collection (so if I had a another web application with a site collection, that would be shown in the selection box as well).&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;After successfully integrating, a Reporting Services option appears under the site collection site settings:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClpZyNe7I/AAAAAAAAAPc/YyZl7E0SvD4/s1600-h/Reporting+Services+in+Site+Settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="408" mt="true" src="http://1.bp.blogspot.com/_gmYwAJepiK4/S2ClpZyNe7I/AAAAAAAAAPc/YyZl7E0SvD4/s640/Reporting+Services+in+Site+Settings.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That's about as far as I have gotten so far. I did, however, wanted to check BIDS to see what Data Sources were available. I had a&amp;nbsp;hunch that a SharePoint list would now be an integrated option (instead of having to create an extension as I have done before in SQL 2005). I was right:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_gmYwAJepiK4/S2CnM1u8-wI/AAAAAAAAAPs/WVnove-B0Pk/s1600-h/SQL+2008+R2+-+Reporting+Services+Data+Source.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="470" mt="true" src="http://2.bp.blogspot.com/_gmYwAJepiK4/S2CnM1u8-wI/AAAAAAAAAPs/WVnove-B0Pk/s640/SQL+2008+R2+-+Reporting+Services+Data+Source.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I am pretty sure that wasn't in there before I installed R2. &lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So overall in SharePoint 2010 it's the same process to install Reporting Services in Integrated Mode but with the SQL Server 2008 R2 installs.&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-1125244935834347285?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/1125244935834347285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=1125244935834347285' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1125244935834347285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1125244935834347285'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/01/sql-server-2008-reporting-services.html' title='SQL Server 2008 Reporting Services Integration with SharePoint 2010'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_gmYwAJepiK4/S2CQGzaPQ3I/AAAAAAAAAO8/gVbcugkvU3Y/s72-c/SSRS+2008+in+SharePoint+2010+Install.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6313605348167904548</id><published>2010-01-18T17:23:00.002-05:00</published><updated>2010-01-18T17:25:18.592-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='Pie Chart'/><title type='text'>SSRS 2008 Pie Chart Formatting</title><content type='html'>&lt;p&gt;I was involved with a client where after building the warehouse to host the data, one of user deliverables was delivering a SSRS report that contained many different types of charts. One of the charts that had a wrinkle to it was a Pie Chart that broke down customer dollars by category and then comparing that customer to its industry to see the percentages of where the client's customer income was in relation to the rest of the industry that the customer belonged. For this report, the customer was a parameter and it would display the appropriate information based upon the customer selection by my client.&lt;/p&gt;&lt;p&gt;Building two Pie Charts and having them side by side on the SSRS Report to display these percentages and dollars was a great way to compare the results but it had a couple of formatting issues that I would like to share.&lt;/p&gt;&lt;p&gt;For the requirement, I needed both charts to have the same colors representing the same category in each chart. I could have hard coded the categories but then the report would not have been very flexible if new categories were introduced into the data down the line. To solve this problem, I had to display all of the category types (simple left join) in the legend for the industry and the customer charts. Originally, I only showed those categories that each belonged to but if a customer only was involved in a subset of what the total industry would be involved in, the color coding of the charts would not be in synch. The first requirement was now solved using the left join but now I had a new problem.&lt;/p&gt;&lt;p&gt;Adding the left join now meant that I was retrieving all categories that could have a percentage of 0 since not all customers were involved in every category that the customer's industry was mapped. When displaying that on the chart and trying to show percentages and dollar amounts, if there were multiple categories that a customer did not have, all of the 0 percents and dollars became one garbled mess of characters. &lt;/p&gt;&lt;p&gt;Luckily, in SSRS 2008, one can change the formatting of the Pie Chart's Label Series using Keywords and combining that with a numeric string format. The keywords can be found in the Adding Chart Keywords section in the &lt;a href="http://msdn.microsoft.com/en-us/library/bb677551.aspx"&gt;Formatting Data Points on a Chart&lt;/a&gt; article on MSDN, the numeric strings can be found at the &lt;a href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx"&gt;Custom Numeric Format String&lt;/a&gt; section on MSDN.&lt;/p&gt;&lt;p&gt;To go to the Label formats, right click on the Labels within the chart and select the Series Label Properties:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Bb_dqfXVtDU/S1TfXdGz0dI/AAAAAAAAAFc/myF03ji07I4/s1600-h/SSRS_Pie_Chart_Label_Series%5B3%5D.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" border="0" alt="SSRS_Pie_Chart_Label_Series" src="http://lh3.ggpht.com/_Bb_dqfXVtDU/S1TfXv8UrxI/AAAAAAAAAFg/1r1_76nl7tg/SSRS_Pie_Chart_Label_Series_thumb%5B1%5D.jpg?imgmax=800" width="381" height="365" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The properties will display and in the General option, implement the Chart Keywords and a custom numeric format string combination:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Bb_dqfXVtDU/S1TfYMhj4SI/AAAAAAAAAFk/frDnNfqpUd0/s1600-h/SSRS_Pie_Chart_Label_Data%5B9%5D.jpg"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" border="0" alt="SSRS_Pie_Chart_Label_Data" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/S1TfYfGQxPI/AAAAAAAAAFo/V2LjXDAKrHI/SSRS_Pie_Chart_Label_Data_thumb%5B7%5D.jpg?imgmax=800" width="593" height="157" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;For the example, I implemented the following format: #PERCENT{#%;;""} #VALY{$#,###;;""}. Notice, after the keyword, the format is laid out and the Section Separator ";" splits the following types of values into "POSTIVE;NEGATIVE;0" and what format to apply to each type of numeric value. &lt;/p&gt;&lt;p&gt;For the 0 value, I put in an empty string and therefore the combining of empty categories did not display in the Pie Chart itself but the category would still show up in the Legend.&lt;/p&gt;&lt;p&gt;The Pie Chart also has the capability to group percentages together below a certain threshold (percents or dollars) to then allow for a custom title for that category. However, for the customer vs the industry scenario and the color coordination of the legends, this avenue would not apply since I was not guaranteed the same combination of categories for the industry would be setup for the customer, which was the point of the chart in the first place.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6313605348167904548?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6313605348167904548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6313605348167904548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6313605348167904548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6313605348167904548'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2010/01/ssrs-2008-pie-chart-formatting.html' title='SSRS 2008 Pie Chart Formatting'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_Bb_dqfXVtDU/S1TfXv8UrxI/AAAAAAAAAFg/1r1_76nl7tg/s72-c/SSRS_Pie_Chart_Label_Series_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4702852731990710854</id><published>2009-10-30T13:08:00.000-04:00</published><updated>2009-10-30T13:08:58.433-04:00</updated><title type='text'>Hosting SQL Server on VMWare</title><content type='html'>One of our clients was investigating the logistics of running SQL Server on VMWare. In discussions with Microsoft, the response included&amp;nbsp;four (4) important links. I personally have seen various SQL Server performance issues when virtualizing especially in a SharePoint environment and I would never trust that configuration. There have been many enhancements with SQL Server 2005 and now SQL Server 2008 in order to consolidate servers and take advantage of reducing hardware needs and license costs. A good SQL Server 2008 consolidation white paper can be found &lt;a href="http://download.microsoft.com/download/6/9/D/69D1FEA7-5B42-437A-B3BA-A4AD13E34EF6/SQLServer2008Consolidation.docx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here is the info from the Microsoft technician:&lt;br /&gt;&lt;br /&gt;If you are running ESX V3.5 the latest hotfixes from VMware to disable write-caching are included in update3 and update 4.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;897613"&gt;The Microsoft Virtual Server support policy&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;a href="http://kb.vmware.com/kb/1008542"&gt;The VMware knowledge base article that you can contact VMware about for hosting SQL Server &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;a href="http://sqlsolutions.com/articles/articles/SQL_Server_and_VMware-A_Potentially_Fatal_Combination.htm"&gt;This article that explains the issue&amp;nbsp;and&amp;nbsp;discusses&amp;nbsp;the problem domain&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://download3.vmware.com/vmworld/2006/dvt4696.pdf"&gt;Here is an presentation from VMWare about how to disable the disk write issue.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4702852731990710854?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4702852731990710854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4702852731990710854' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4702852731990710854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4702852731990710854'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/10/hosting-sql-server-on-vmware.html' title='Hosting SQL Server on VMWare'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6503224145134010482</id><published>2009-10-29T11:03:00.001-04:00</published><updated>2009-10-29T11:07:19.124-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='MERGE Statement'/><category scheme='http://www.blogger.com/atom/ns#' term='WHERE in MERGE'/><category scheme='http://www.blogger.com/atom/ns#' term='WHEN Clause'/><title type='text'>To MERGE or not to MERGE in SQL Server 2008</title><content type='html'>I was reviewing some demo material for the MERGE statement that Jim Pletscher put together. It was a standard scenario where we wanted to UPDATE, DELETE, or INSERT rows from a source table to a target table. A general overview of this is available &lt;a href="http://sqlserver-indo.org/blogs/kasimwirama/archive/2009/07/22/merge-statement-in-sql-server-2008.aspx"&gt;here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Inserting is harmless&amp;nbsp;but what if sometimes we don't want to&amp;nbsp;update or delete&amp;nbsp;something from our target table? &lt;br /&gt;&lt;br /&gt;My first step was to add a new column to the target table. I named this column "DoNotTouch" and made it a bit defaulting to zero (0). I then set this value to one (1) on one of the target table rows. &lt;br /&gt;&lt;br /&gt;So now how do we tell the MERGE statement to not touch anything where this bit is flipped on? You cannot use a WHERE clause in the MERGE statement. The answer is within the WHEN clause of the MERGE statement. All you need to do is add an additional condition to each WHEN for the update and delete operations:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;(TargetTable is the name of the target table and SourceTable is the name of the source table)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;WHEN MATCHED &lt;strong&gt;&lt;span style="color: blue;"&gt;AND &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;TargetTable&lt;/span&gt;.DoNotTouch&amp;lt;&amp;gt; 1&lt;/span&gt;&lt;/strong&gt; THEN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE SET TargetTable.FirstName = SourceTable.firstname,&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TargetTable.LastName = SourceTable.lastname&lt;br /&gt;&lt;br /&gt;WHEN NOT MATCHED BY SOURCE &lt;span style="color: blue;"&gt;&lt;strong&gt;AND TargetTable.DoNotTouch&amp;lt;&amp;gt; 1 &lt;/strong&gt;&lt;/span&gt;THEN&lt;br /&gt;DELETE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So that worked! It did not touch the row where I set the DoNotTouch flag to one (1).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6503224145134010482?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6503224145134010482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6503224145134010482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6503224145134010482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6503224145134010482'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/10/to-merge-or-not-to-merge-in-sql-server.html' title='To MERGE or not to MERGE in SQL Server 2008'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-1948879463852750604</id><published>2009-10-22T16:12:00.021-04:00</published><updated>2009-10-23T10:24:08.408-04:00</updated><title type='text'>Introduction to Change Data Capture</title><content type='html'>The Change Data Capture feature is a new feature in SQL Server 2008 that allows processes to&lt;br /&gt;quickly and easily identify changes to a table in SQL Server 2008. It primarily works by watching the SQL server transaction logs, and running processes that pull changes from the logs and moving them into tables.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Change Data Capture Setup&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enabling Change Data Capture is a two step process. First, you must enable it at the database level, then you must enable it for &lt;strong&gt;&lt;em&gt;each &lt;/em&gt;&lt;/strong&gt;table for which changes must be recorded.&lt;br /&gt;&lt;br /&gt;The first step in setting up Change Data Capture is to enable the option at the Database Level. The easiest way to do this is to use the system stored procedure &lt;em&gt;&lt;strong&gt;sys.sp_cdc_enable_db.&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;Simply execute this stored procedure from the desired database, and it will enable change data capture for the database. This stored procedure requires sysadmin privilege in order to execute it.&lt;br /&gt;&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDFKy0PXyI/AAAAAAAAAGw/fB7WeXThN0E/s1600-h/query6.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; FLOAT: left; HEIGHT: 186px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395529142820101922" border="0" alt="" src="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDFKy0PXyI/AAAAAAAAAGw/fB7WeXThN0E/s400/query6.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once it is enabled at the database level, the Capture Change Data option must be enabled for each table for which changes should be captured. Use the &lt;strong&gt;&lt;em&gt;sys.sp_cdc_enable_table&lt;/em&gt;&lt;/strong&gt; stored procedure to enable the feature, passing the table name as an argument in order to enable the feature. By default, all of the columns in the source table are identified as captured columns. If only a subset of columns need to be tracked, such as for privacy or performance reasons, use the &lt;em&gt;&lt;strong&gt;@captured_column_list&lt;/strong&gt;&lt;/em&gt; parameter to specify the subset of columns.&lt;br /&gt;&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_-3dA1VkFWb8/SuDFD3N5PVI/AAAAAAAAAGo/qF08p6vVokg/s1600-h/query5.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; FLOAT: left; HEIGHT: 250px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395529023742360914" border="0" alt="" src="http://3.bp.blogspot.com/_-3dA1VkFWb8/SuDFD3N5PVI/AAAAAAAAAGo/qF08p6vVokg/s400/query5.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once Change Data Capture (CDC) is enabled for a table, several things occur. First, an associated capture instance is created to support the collection of the change data in the source table. The capture instance consists of a change table and up to two query functions.&lt;br /&gt;&lt;br /&gt;All inserts, updates, and deletes to the source table are stored in the change table. The two query functions are specific to the source table, and can be used to fetch changes from the change table.&lt;br /&gt;&lt;br /&gt;The first five columns of a change data capture change table are metadata columns. These provide additional information that is relevant to the recorded change. The remaining columns mirror the identified captured columns from the source table in name. These columns hold the captured column data that is gathered from the source table.&lt;br /&gt;&lt;br /&gt;Each insert or delete operation that is applied to a source table appears as a single row within the change table. The data columns of the row that results from an insert operation contain the column values after the insert. The data columns of the row that results from a delete operation contain the column values before the delete. An update operation requires one row entry to identify the column values before the update, and a second row entry to identify the column values after the update.&lt;br /&gt;&lt;br /&gt;In additon to the Change instance, two SQL Agent Jobs are created: one that is used to populate the database change tables, and one that is responsible for change table cleanup. Both jobs consist of a single step that runs a Transact-SQL command. The Transact-SQL command that is invoked is a change data capture defined stored procedure that implements the logic of the job.&lt;br /&gt;&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDE_Xwp4AI/AAAAAAAAAGg/BtvOYy-9pg8/s1600-h/query4.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 368px; FLOAT: left; HEIGHT: 250px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395528946578743298" border="0" alt="" src="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDE_Xwp4AI/AAAAAAAAAGg/BtvOYy-9pg8/s400/query4.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The jobs are created when the first table of the database is enabled for change data capture. The Cleanup Job is always created. The capture job will only be created if there are no existing transactional publications for the database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;Using Change Capture Data&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Change data is made available to change data capture prcoesses via the two functions that are created when the change instance is created. Both functions require Log Sequence Numbers (LSNs) to help define the date range of change data to return in the resultset.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The function &lt;strong&gt;&lt;em&gt;cdc.fn_cdc_get_all_changes_&lt;capture_instance&gt;&lt;/em&gt;&lt;/strong&gt; returns all changes that occurred for the specified interval. Entries are always returned sorted, first by the transaction commit LSN of the change, and then by a value that sequences the change within its transaction.&lt;br /&gt;&lt;br /&gt;The function &lt;strong&gt;&lt;em&gt;cdc.fn_cdc_get_net_changes_&lt;capture_instance&gt;&lt;/em&gt;&lt;/strong&gt; returns one change per modified source table row. If more than one change is logged for the row during the specified time period, the column values will reflect the final contents of the row.&lt;br /&gt;&lt;br /&gt;Several functions are provided to help determine appropriate LSN values for use in querying the change data capture functions. For example, the functions &lt;strong&gt;&lt;em&gt;sys.fn_cdc_map_time_to_lsn&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;sys.fn_cdc_map_lsn_to_time&lt;/em&gt;&lt;/strong&gt; are available to help place LSN values on a conventional timeline.&lt;br /&gt;&lt;br /&gt;To illustrate, insert a single record into sample table created earlier, then update the columns.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_-3dA1VkFWb8/SuDCUeD64iI/AAAAAAAAAGQ/Wi6Gh7BuiWw/s1600-h/Query2.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; FLOAT: left; HEIGHT: 250px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395526010512532002" border="0" alt="" src="http://2.bp.blogspot.com/_-3dA1VkFWb8/SuDCUeD64iI/AAAAAAAAAGQ/Wi6Gh7BuiWw/s400/Query2.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now we can use the cdc.fn_cdc_get_all_changes to set how the change table is populated:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_-3dA1VkFWb8/SuDhqVPG3tI/AAAAAAAAAHY/mkZJTg71yM0/s1600-h/Query8.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; FLOAT: left; HEIGHT: 250px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395560470961118930" border="0" alt="" src="http://2.bp.blogspot.com/_-3dA1VkFWb8/SuDhqVPG3tI/AAAAAAAAAHY/mkZJTg71yM0/s400/Query8.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note that the resulting change table contains four records, with the source table columns populated with the table data surrrounding the change. The first record reflects the initial insert. The 2nd and 3rd records reflect the update (a delete followed by new insert), while the fourth record reflects the final delete.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that running the cdc.fn_cdc_get_&lt;strong&gt;&lt;em&gt;net&lt;/em&gt;&lt;/strong&gt;_changes returns only a single row, which represents the newest version of any modified row. This procedure will only return one change table record per source record changed, regardless of how many changes were made to the source record.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDCCXflivI/AAAAAAAAAGI/0BEOHLeJtUk/s1600-h/Query1.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 400px; FLOAT: left; HEIGHT: 278px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5395525699511880434" border="0" alt="" src="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDCCXflivI/AAAAAAAAAGI/0BEOHLeJtUk/s400/Query1.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDAx8P7vvI/AAAAAAAAAFw/-VK54jqnH2E/s1600-h/Query1.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-1948879463852750604?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/1948879463852750604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=1948879463852750604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1948879463852750604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1948879463852750604'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/10/introduction-to-change-data-capture.html' title='Introduction to Change Data Capture'/><author><name>Rich Cargile</name><uri>http://www.blogger.com/profile/15219630895270441765</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_-3dA1VkFWb8/SuDFKy0PXyI/AAAAAAAAAGw/fB7WeXThN0E/s72-c/query6.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-1893034238270632117</id><published>2009-09-28T23:26:00.002-04:00</published><updated>2009-09-28T23:30:42.268-04:00</updated><title type='text'>Business Intelligence and Silverlight</title><content type='html'>Looking forward to an upcoming book on two of my favorite areas of interest:  Business Intelligence and Silverlight.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://silverlighthack.com/post/2009/09/20/Announcing-Next-Generation-Business-Intelligence-Software-with-Silverlight.aspx"&gt;http://silverlighthack.com/post/2009/09/20/Announcing-Next-Generation-Business-Intelligence-Software-with-Silverlight.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-1893034238270632117?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/1893034238270632117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=1893034238270632117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1893034238270632117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1893034238270632117'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/09/business-intelligence-and-silverlight.html' title='Business Intelligence and Silverlight'/><author><name>Brian McCullough</name><uri>http://www.blogger.com/profile/03631616681884901656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-349817789531973185</id><published>2009-09-28T22:33:00.003-04:00</published><updated>2009-09-28T23:23:08.944-04:00</updated><title type='text'>SQL Server 2005 vs 2008 Query Performance</title><content type='html'>I was recently working on a transactional web application for a client.  This web application had some "operational" type reports included within it that required aggregations of, what will eventually be, millions of rows of data.  This meant I'd be writing queries directly against the transactional tables doing the aggregations (SUMs and COUNTs mostly) "on demand".  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note: In more heavily used applications, aggregating as much data as we were on demand might not be acceptable, but in this case we were measuring in transactions "per minute" and "per hour" rather then "per second", so we did not anticipate any blocking of our queries by database writes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These queries were going to be used on the landing page for web application seen by every employee within the company.  The landing page receives 20,000 hits per day over roughly 17 hours of operation a day.  This is about 19 hits per minute or 1 hit every 3 seconds.  Not all that much compared to many applications I've seen, but definitely enough to warrant some sort of load/performance testing under a larger data load.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I set up some SQL scripts to, somewhat randomly, load a data sample that was representative of about 2 years worth of data.  My initial query times were awful, and as I suspected, there was some room for improvement.  I did some refactoring (with some help from a friend) and had things running at about 1-2 seconds per query.  I thought there was still some room for improvement, but this was within an acceptable range.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thinking things were fine, I promoted my code from my local development environment to our integration environment.  I then ran my data load script to test in that environment, and suprisingly, was seeing query times in the 20-25 second range.  WHAT?!?  I just tuned things.  After some tinkering, and reloading of data, I was seeing the inconsistencies in my query times.  Sometimes in the 20-25 second range, other times in the 3-5 second range.  What was going on?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My initial thought was that there was something different in the query processing between my local development environment (SQL Server &lt;b&gt;2008 Developer&lt;/b&gt; Edition) and the integration environment (SQL Server &lt;b&gt;2005 Standard&lt;/b&gt; edition).  Some quick searches found that I might be using the &lt;a href="http://msdn.microsoft.com/en-us/library/ee410012.aspx"&gt;Star Join Query Optimization&lt;/a&gt; available in 2008 Developer/Enterprise editions.  There are &lt;a href="http://blogs.msdn.com/sqlqueryprocessing/archive/2007/04/09/how-to-check-whether-the-final-query-plan-is-optimized-for-star-join.aspx"&gt;ways that I could have confirmed this assumption&lt;/a&gt;, but I did not spend the time to do so.  Regardless if I was or wasn’t using this optimaztion, I still didn’t want to take a chance that there might have been something else in the query processor that was making things more “efficient” on 2008 Developer vs 2005 Standard.  I thought it’d be more reliable if I just set up a more representative environment and did my testing/tuning there.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I built a 2005 Standard virtual machine, built my application, loaded sample data, and ran the queries.  Started seeing query times similar to our integration environment.  OK, so it was reproduceable.  Now let's tune it.  I went straight to an indexed view I was using for the query, made a minor tweak.  As I ran the script to rebuild the indexed view, it hit me.  I had just loaded 2 years worth of data, and had done no database maintenance that would "normally" be done gradually, such as rebuilding indexes and defragging the hard drive.  I rebuilt my indexes, defragged the drive, and sure enough my query times were back down in the 1-2 second range.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After tweaking just a bit more by including my numeric columns used in my query aggregations in an index, I redeployed to our integration environment and finally started getting consistent and performant results.&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;span style="color:#1F497D"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;A few important take-aways here...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;In order to truly gauge/test performance, perform maintenance on your development/test environment just as you would in a “normal” environment, especially after large data loads.  That is rebuild your indexes, defrag the hard drive, etc.&lt;/li&gt;&lt;li&gt;Always (or to the extent possible) develop and/or test on machines that are representative of the environment you are actually going to deploy to, especially with regards to versions/editions of applications being used.  There are many features within SQL Server that are only available in the Enterprise Edition of the product, including some query optimizations.  I usually do this, but for a long period of time on my current project, the client couldn’t give a definitive answer on what our environments would look like, so we continued development with what we originally started with (which was no longer valid).  Once I built a more representative environment of what I was actually deploying to, then deployed my application and test data there, I was able to troubleshoot and fix the issue more quickly.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-349817789531973185?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/349817789531973185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=349817789531973185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/349817789531973185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/349817789531973185'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/09/sql-server-2005-vs-2008-query.html' title='SQL Server 2005 vs 2008 Query Performance'/><author><name>Brian McCullough</name><uri>http://www.blogger.com/profile/03631616681884901656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-8124521977573377947</id><published>2009-09-10T12:54:00.007-04:00</published><updated>2009-09-15T19:10:59.435-04:00</updated><title type='text'>Excel Services Part Deux - Excel Web Services</title><content type='html'>In an earlier blog entry, I discussed in very broad terms Microsoft Excel Services – a server side calculation engine that can be leveraged for SharePoint Business Intelligence solutions. Excel Services, you may recall, is divided into three components; Excel Calculation Services (ECS), Excel Web Access (EWA), and Excel Web Services (EWS). Excel Web Services allows access to the Excel Calculation Engine via Web Service calls, and is today’s focus.&lt;br /&gt;&lt;br /&gt;Excel Web Services utilizes SOAP over http and acts as an interface between custom client programs and Excel Services. In order to call the service, it is necessary to establish a reference to the Excel Web Services WSDL, accessed through ExcelService.asmx?wsdl. However, if you are writing code within SharePoint Services (for example, developing custom web parts), Microsoft recommends linking directly to Microsoft.Office.Excel.Server.WebServices.dll and making local calls rather than using loop-back SOAP calls.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EWS - What is it good for?&lt;/strong&gt;&lt;br /&gt;Absolutely nothing (say it again…)? No, there are a number of practical examples where utilizing Excel Web Services comes in handy. One common scenario occurs when a company’s business logic is embedded in Excel spreadsheets. These spreadsheets can be maintained on a corporate server, and custom applications developed to utilize the logic in the spreadsheet without having to recode it in a “conventional” programming language. This also means that the spreadsheet logic can be maintained by business Subject Matter Experts (SMEs) who are comfortable working in Excel. Custom code can be developed to set values to cells and ranges, process the workbook, and retrieve calculated values (or even the entire workbook).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Coding Steps 101&lt;/strong&gt;&lt;br /&gt;Dealing with EWS is relatively straightforward, and numerous code examples can be found in the literature and on the web, such as here: &lt;a href="http://blogs.msdn.com/excel/archive/2005/11/21/495454.aspx"&gt;http://blogs.msdn.com/excel/archive/2005/11/21/495454.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Typical steps involved in coding against EWS are as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Instantiate the web service via creation of &lt;span style="font-family:courier new;"&gt;ExcelService&lt;/span&gt; object&lt;br /&gt;2. Set the URL via &lt;span style="font-family:courier new;"&gt;ExcelWebService&lt;/span&gt; property&lt;br /&gt;3. Set the credentials via&lt;span style="font-family:courier new;"&gt; Credentials&lt;/span&gt; property. Default credentials (using applications own credentials) can be used by setting this property to &lt;span style="font-family:courier new;"&gt;System.Net.CredentialCache.DefaultCredentials&lt;/span&gt;.&lt;br /&gt;4. Start the Session by calling &lt;span style="font-family:courier new;"&gt;OpenWorkbook()&lt;/span&gt; method&lt;br /&gt;5. Set Cell Parameters via &lt;span style="font-family:courier new;"&gt;SetCell()&lt;/span&gt; method&lt;br /&gt;6. Calculate Spreadsheet (if workbook not set to auto-recalculate) via&lt;span style="font-family:courier new;"&gt; Calculate() &lt;/span&gt;or &lt;span style="font-family:courier new;"&gt;CalculateWorkbook()&lt;/span&gt; method&lt;br /&gt;7. Retrieve the Results via &lt;span style="font-family:courier new;"&gt;GetCell()&lt;/span&gt; method&lt;br /&gt;8. Close Session via call to &lt;span style="font-family:courier new;"&gt;CloseWorkbook()&lt;/span&gt; method&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Other methods are available as well, including the ability to set a range of cells and read an entire workbook into memory.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business Example&lt;/strong&gt;&lt;br /&gt;An RDA client manages a customer support system that utilizes a custom authorization engine that controls which support agents have access to specific functionality within the application. For example, agents that support a specific product line do not have access to workflows supporting other product lines, and only agents of a certain tier level have the rights to issue refunds to customers. Although this authorization data is stored in a relational database, an Excel Spreadsheet on a SharePoint site is used by both the business and application support personnel to maintain and modify this information. When changes are made, the spreadsheet is loaded into the relational database through custom software.&lt;br /&gt;&lt;br /&gt;This approach has a number of benefits:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. SharePoint is used as a means of version control, to maintain a historical record of changes made.&lt;br /&gt;2. Anyone with access to the SharePoint site can view the details surrounding the current authorization hierarchy, without the need for special software or reports.&lt;br /&gt;3. The spreadsheet itself contains business logic to help organize the information and maintain data integrity.&lt;br /&gt;4. The spreadsheet is easy to use and modify for subject matter experts who may not have a programming background.&lt;br /&gt;&lt;br /&gt;However, as initially conceived there are some difficulties associated with this approach:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Making changes and deploying to the relational database involves a number of time-intensive manual steps, including downloading the spreadsheet, exporting to XML, applying an XSLT transform, and executing a custom application.&lt;br /&gt;2. In addition to the labor involved, the manual steps are prone to error.&lt;br /&gt;3. In the event that the changes made are not what were desired, either through human error or a change in business strategy, rollback of the changes can be difficult.&lt;br /&gt;&lt;br /&gt;Excel Web Services can provide an ideal platform to address these shortcomings. A SharePoint web part or other custom application can be developed that, utilizing Excel Services, can recalculate and read the latest spreadsheet data, generate the necessary output, and load the relational database in (from an end users point of view) a single step. No modifications to the existing spreadsheet logic would be necessary, and the business users can use and maintain the spreadsheet as before. SharePoint security can be leveraged to restrict access to the Web Part. In addition, custom rollback functionality can be added via code.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Finally…&lt;/strong&gt;&lt;br /&gt;As indicated in my last installment, relying on business logic residing in an Excel spreadsheet may not be considered “ideal” from an architectural standpoint – but is often a necessity when practical considerations such as time, budget, staff experience, and maintainability come into play. Excel Web Services provides an IT organization a valuable tool to leverage that platform for maximum benefit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-8124521977573377947?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/8124521977573377947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=8124521977573377947' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8124521977573377947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8124521977573377947'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/09/excel-services-part-deux-excel-web.html' title='Excel Services Part Deux - Excel Web Services'/><author><name>Michael Izsak</name><uri>http://www.blogger.com/profile/02118212636031296004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6391846834014828481</id><published>2009-08-24T08:20:00.008-04:00</published><updated>2009-08-24T08:52:18.811-04:00</updated><title type='text'>SSIS Data Flow Task – OleDBCommand Task on ORACLE database throwing “Provider cannot derive parameter information” error</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;strong&gt;Problem&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;We were trying to update a table in Oracle database within a dataflow task. OleDbCommand transformation task is used for the purpose. The update statement takes some parameters. SSIS could not resolve the parameter information and throw error “Provider cannot derive parameter information”. We are using SSIS 2005 and Oracle 10G .NET drivers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;strong&gt;Analysis&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;Typically, OleDbCommand transformation task automatically resolves the parameters based on the SQL statement. For example, let’s try updating a same table in SQL Server database and Oracle database&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL Statement:&lt;/strong&gt; UPDATE Employee SET Bonus = ? WHERE EmpID = ?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;With SQL Server &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Set the SQL Server connection in “Connection Managers” tab. Fill the SQL statement in the “Component Properties” tab as shown below.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_NszYjBYumWY/SpKJkwPlUPI/AAAAAAAAASY/6YEYMDMW0cU/s1600-h/1.JPG"&gt;&lt;img style="WIDTH: 312px; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373508569924980978" border="0" alt="" src="http://1.bp.blogspot.com/_NszYjBYumWY/SpKJkwPlUPI/AAAAAAAAASY/6YEYMDMW0cU/s320/1.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 1 - Adding SQL Statement to OleDbCommand Task&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you check the “Column Mapings” tab in the OleDBCommand transformation task, you would see the parameters list as follows. SSIS automatically resolves the parameters needed. Map the columns appropriately and the Data Transformation task is ready&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_NszYjBYumWY/SpKJkROSpZI/AAAAAAAAASQ/sFo6va47u2s/s1600-h/2.JPG"&gt;&lt;img style="WIDTH: 312px; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373508561598064018" border="0" alt="" src="http://4.bp.blogspot.com/_NszYjBYumWY/SpKJkROSpZI/AAAAAAAAASQ/sFo6va47u2s/s320/2.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 2 - Parameters List (SSIS automatically resolved) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;With Oracle&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;When the same SQL is tried on Oracle database, SSIS throws the following exception. SSIS cannot figure out the parameters automatically.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Validation error. Update Oracle Table: UPDATE Employee [60]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E51. An OLE DB record is available. Source: "OraOLEDB" Hresult: 0x80040E51 Description: "Provider cannot derive parameter information and SetParameterInfo has not been called.".&lt;br /&gt;Validation error. Update Oracle Table: UPDATE Employee [60]: Unable to retrieve destination column descriptions from the parameters of the SQL command.&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_NszYjBYumWY/SpKJkGdjFJI/AAAAAAAAASI/ZeBlPf784iw/s1600-h/3.JPG"&gt;&lt;img style="WIDTH: 320px; HEIGHT: 237px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373508558709265554" border="0" alt="" src="http://4.bp.blogspot.com/_NszYjBYumWY/SpKJkGdjFJI/AAAAAAAAASI/ZeBlPf784iw/s320/3.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 3 - SSIS failed to resolve the parameters with Oracle database&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:180%;"&gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Do not know if this is bug in SSIS. But one way to resolve is to add the parameters manually. Go to the “Input and Output Properties” tab and add the parameters manually. Add the parameters with the appropriate data type and in the same order as they appear in the SQL statement. This resolves the error and you can map the input columns to parameters.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_NszYjBYumWY/SpKJj9zVQpI/AAAAAAAAASA/JBhKsTLARj4/s1600-h/4.JPG"&gt;&lt;img style="WIDTH: 311px; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373508556384715410" border="0" alt="" src="http://1.bp.blogspot.com/_NszYjBYumWY/SpKJj9zVQpI/AAAAAAAAASA/JBhKsTLARj4/s320/4.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 4 - Adding parameters manually&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_NszYjBYumWY/SpKJjaOVdoI/AAAAAAAAAR4/qB7aPc7Uc00/s1600-h/5.JPG"&gt;&lt;img style="WIDTH: 312px; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373508546834298498" border="0" alt="" src="http://3.bp.blogspot.com/_NszYjBYumWY/SpKJjaOVdoI/AAAAAAAAAR4/qB7aPc7Uc00/s320/5.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 5 - Parameters added manually&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_NszYjBYumWY/SpKIgJlwCQI/AAAAAAAAARI/m_RNa3oeZyQ/s1600-h/6.JPG"&gt;&lt;img style="WIDTH: 312px; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5373507391317870850" border="0" alt="" src="http://1.bp.blogspot.com/_NszYjBYumWY/SpKIgJlwCQI/AAAAAAAAARI/m_RNa3oeZyQ/s320/6.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 6 - Map the parameters to Input columns&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6391846834014828481?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6391846834014828481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6391846834014828481' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6391846834014828481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6391846834014828481'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/08/ssis-data-flow-task-oledbcommand-task.html' title='SSIS Data Flow Task – OleDBCommand Task on ORACLE database throwing “Provider cannot derive parameter information” error'/><author><name>Sarma Musty</name><uri>http://www.blogger.com/profile/04450720434203290103</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NszYjBYumWY/SpKJkwPlUPI/AAAAAAAAASY/6YEYMDMW0cU/s72-c/1.JPG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4391623713362113387</id><published>2009-08-21T13:04:00.009-04:00</published><updated>2009-08-21T14:07:10.414-04:00</updated><title type='text'>Reporting Services 2008 Parameter Dependencies &amp; Choosing Multiple Parameter Values</title><content type='html'>As was the case with prior versions, Reporting Services 2008 allows you to establish parameter dependencies and to allow mutiple parameter values be chosen. This means that parameter values provided to the end user can be dependent upon or driven by prior parameter value choices. In this example we’ll see how this can be done using a very simple AdventureWorks2008 Sales Data example report.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The AdventureWorks Sales Detail Report displays line-item sales details for a given product category, product subcategory and product. Our goal is to allow the end-user to specify the product category from the following available list (Accessories, Bikes, Clothing, Components). Once a Product Category choice is made, the available Product SubCategory choices for the chosen Product Categories are determined and displayed in the Product SubCategory drop-down list. In the screen snapshot below we chose Bikes and Clothing as our Product Category choices. For our Product Subcategory choices we chose Mountain Bikes (Bikes), Road Bikes (Bikes) and Caps (Clothing). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_k60MffeGnb4/So7YiDtvvsI/AAAAAAAAADg/i2otZdET_Ww/s1600-h/Full+Report.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5372469485123911362" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 250px" alt="" src="http://4.bp.blogspot.com/_k60MffeGnb4/So7YiDtvvsI/AAAAAAAAADg/i2otZdET_Ww/s400/Full+Report.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_k60MffeGnb4/So7W01kfSJI/AAAAAAAAADQ/_2j9Afn_7ZE/s1600-h/Full+Report.jpg"&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Notice that our Product Category is displayed along with the Product Subcategory in the following format: Product SubCategory (Product Category)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Our product subcategory choices are below:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Mountain Bikes (Bikes)&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Touring Bikes (Bikes)&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Caps (Clothing)&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;This was done just to tell the report viewer what category a subcategory belongs to. This was done because the subcategory / category relationship was not always obvious by name! &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Parameters and Dependencies&lt;/strong&gt;&lt;br /&gt;Our sample report uses two parameters: Product Category and Product SubCategory. The subcategory choices are driven by or dependent upon the product category choice. In this section we’ll see exactly how this is done and also look at how we provide both the category and subcategory names to the end-user.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Product Category Parameter&lt;/strong&gt;&lt;br /&gt;The Product Category choices are provided by selecting the Name column form the ProductCategory table in the AdventureWorks2008 database. Below is the SQL code to provide the ProductCategory choices:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;SELECT distinct&lt;br /&gt;Name as ProductCategoryName&lt;br /&gt;FROM&lt;br /&gt;Production.ProductCategory&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Notice that this parameter does not include any parameter dependencies since it is our initial choice. The Report Data window below allows us to define the parameter specifics such as the parameter name, parameter label, parameter data type, where the available values come from, what default value should be used, …&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Below we see the Report Data window which allows us to create and fine-tune our parameters.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_k60MffeGnb4/So7WW1oGLKI/AAAAAAAAADI/M8fw5_czvig/s1600-h/Report+Data.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5372467093340302498" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 329px; CURSOR: hand; HEIGHT: 271px" alt="" src="http://2.bp.blogspot.com/_k60MffeGnb4/So7WW1oGLKI/AAAAAAAAADI/M8fw5_czvig/s400/Report+Data.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;If we double-click on our highlighted parameter entry we see the Parameter Name, label and data type specified below. Notice that we also allow end-users to choose more than a single parameter value.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_k60MffeGnb4/So7X1y-YSPI/AAAAAAAAADY/9QvFC-OR-Co/s1600-h/Report+Params+Props.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5372468724716030194" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 373px; CURSOR: hand; HEIGHT: 303px" alt="" src="http://4.bp.blogspot.com/_k60MffeGnb4/So7X1y-YSPI/AAAAAAAAADY/9QvFC-OR-Co/s400/Report+Params+Props.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;In the Available Values tab we specify how the parameter choices are driven by a query. Since this is the case, we specify the DataSet name that is used to provide the available Product Category values. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/So7ZioZeNTI/AAAAAAAAADo/u8v_lFmVa6E/s1600-h/Avail+Values.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5372470594482615602" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 364px; CURSOR: hand; HEIGHT: 316px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/So7ZioZeNTI/AAAAAAAAADo/u8v_lFmVa6E/s400/Avail+Values.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;Product SubCategory Parameter&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The Product SubCategory choices are provided by selecting both the Name column from the ProductCategory table and the Name column from the ProductSubCategory table both in the AdventureWorks2008 database. Using the SQL below, end-users are provided with a list of SubCategory names with the corresponding category name in the following format: &lt;/div&gt;&lt;div&gt;subcategory (category) &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;SELECT&lt;br /&gt;PSC.Name + ' (' + PC.Name + ')' as productsubcategorynameandcategoryname,&lt;br /&gt;PSC.Name as ProductSubCategoryName&lt;br /&gt;FROM&lt;br /&gt;Production.ProductSubCategory PSC&lt;br /&gt;INNER JOIN&lt;br /&gt;Production.ProductCategory PC&lt;br /&gt;ON&lt;br /&gt;PSC.ProductCategoryID = PC.ProductCategoryID&lt;br /&gt;WHERE&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;PC.Name IN ( @ProductCategoryName)&lt;/span&gt;&lt;br /&gt;GROUP BY&lt;br /&gt;PSC.Name, PC.Name&lt;br /&gt;ORDER BY&lt;br /&gt;PC.Name, productsubcategorynameandcategoryname&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Notice this SQL references the ProductCategory parameter using the ‘@’ parameter designator. (This entry was highlighted) This is like saying : “Provide us with Subcategory values given the product category choice that was already made and stored in the &lt;span style="color:#ff0000;"&gt;@ProductCategoryname&lt;/span&gt; parameter.” This is exactly how one can introduce parameter dependencies in reports -- your SQL code can reference one or more report parameters.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;Extracting the Report Data&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div&gt;&lt;br /&gt;So far, we've looked at the SQL-code used to create parameter choices. The following SQL Code is used to extact the actual reporting data:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;SELECT&lt;br /&gt;P.Name as ProductName,&lt;br /&gt;PC.Name as ProductCategoryName,&lt;br /&gt;PSC.Name as ProductSubCategoryName,&lt;br /&gt;SOD.OrderQty,&lt;br /&gt;SOD.UnitPrice,&lt;br /&gt;SOD.OrderQty * SOD.UnitPrice as LineTotal&lt;br /&gt;FROM &lt;/div&gt;&lt;div&gt;Sales.SalesOrderHeader SOH&lt;br /&gt;INNER JOIN&lt;br /&gt;Sales.SalesOrderDetail SOD&lt;br /&gt;ON&lt;br /&gt;SOH.SalesOrderID = SOD.SalesOrderID&lt;br /&gt;INNER JOIN&lt;br /&gt;Production.Product P&lt;br /&gt;ON&lt;br /&gt;SOD.ProductID = P.ProductID&lt;br /&gt;INNER JOIN&lt;br /&gt;Production.ProductSubcategory PSC&lt;br /&gt;ON&lt;br /&gt;PSC.ProductSubcategoryID = P.ProductSubcategoryID&lt;br /&gt;INNER JOIN&lt;br /&gt;Production.ProductCategory PC&lt;br /&gt;ON&lt;br /&gt;PC.ProductCategoryID = PSC.ProductCategoryID&lt;br /&gt;WHERE&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;PC.Name in ( @ProductCategoryName)&lt;br /&gt;and PSC.Name + ' (' + PC.Name + ')' in &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;(@productsubcategorynameandcategoryname)&lt;/span&gt;&lt;br /&gt;ORDER BY&lt;br /&gt;ProductName,&lt;br /&gt;ProductCategoryName,&lt;br /&gt;ProductSubCategoryName&lt;br /&gt;&lt;br /&gt;Notice in the highlighted section we are referencing both the Product Category and the Product SubCategory parameters. In fact, we are actually building the string that include the SubCategory Name and Category Name (i.e. Mountain Bikes (Bikes) ) so this filter matches the choice format the end-user is provided with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;It seems as though things have gotten easier in Reporting Services 2008. I’ve authored reports in both SQL Server 2000 and SQL Server 2005 and I remember using a Transact-SQL function (Split) to slice and dice values from a comma separate string. &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4391623713362113387?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4391623713362113387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4391623713362113387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4391623713362113387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4391623713362113387'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/08/reporting-services-2008-parameter.html' title='Reporting Services 2008 Parameter Dependencies &amp; Choosing Multiple Parameter Values'/><author><name>JoeToscano</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_k60MffeGnb4/So7YiDtvvsI/AAAAAAAAADg/i2otZdET_Ww/s72-c/Full+Report.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-400731220084229146</id><published>2009-08-17T15:52:00.023-04:00</published><updated>2009-08-17T16:55:52.238-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS Extract Dynamic Data Driven Package Variables Expressions'/><title type='text'>SSIS Dynamic Data Driven Extracts</title><content type='html'>&lt;strong&gt;Extracting data from multiple tables: a dynamic SSIS Data-Driven Approach&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;This blog entry looks at how you can use SSIS to extract data from multiple tables leveraging a ‘source table’ that provides the table names to extract data from. This solution utilizes a For Each Container, Package Variables, Package Expressions applied to a package variabe along with an OLEDB Source whose SQL Extract Command is stored in a package variable.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In our sample scenario we receive sales data in tables from a 3’d party. This data is delivered on an unpredictable schedule and when received we’d rather not have to modify our SSIS solution. Instead, we rely on inserting a new row into the source table that tells SSIS what it needs to know about the new source table.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Our Source Table / data driven approach&lt;/strong&gt;&lt;br /&gt;Our dynamic approach involves the use of a source table to drive the SSIS Extract process and designate the tables to extract. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;The Source Table SSIS utilizes is &lt;strong&gt;dbo.SalesSource&lt;/strong&gt; and its schema is below:&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[SalesSource] (&lt;br /&gt;[SalesSourceID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[SourceTableName] [varchar](64) NOT NULL,&lt;br /&gt;[ExtractProcessedFlag] [int] default (0) NULL,&lt;br /&gt;[ExtractProcessingOrder] [int] NULL,&lt;br /&gt;[RowsExtracted] [int] NULL,&lt;br /&gt;[DateTimeExtracted] [datetime] NULL&lt;br /&gt;) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Initially, we have 2 source files to work with so, we start out inserting the following two rows into our &lt;strong&gt;dbo.SalesSource&lt;/strong&gt; table (Notice we really only need to supply values for 3 columns). The SSIS package updates the &lt;em&gt;ExtractProcessedFlag&lt;/em&gt;, &lt;em&gt;RowsExtracted&lt;/em&gt; and &lt;em&gt;DateTimeExtracted&lt;/em&gt; columns upon sucessful completion.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_k60MffeGnb4/Som1u93flNI/AAAAAAAAAB4/bHbHLAtB0S8/s1600-h/Source+Table+Contents.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371023849101956306" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 479px; CURSOR: hand; HEIGHT: 65px" alt="" src="http://2.bp.blogspot.com/_k60MffeGnb4/Som1u93flNI/AAAAAAAAAB4/bHbHLAtB0S8/s400/Source+Table+Contents.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The ExtractProcessingOrder column allows us to specify the order in which we would like to extract data from in our Source Tables. The reason this was required was that our source data may very well contain duplicate data. We specify the order in which we extract and load and have our SSIS packages flag the duplicate rows based on a business key and keep only the most recent data from our duplicates. (In our scenario, new data trumps old data) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Let’s take a look at our SSIS Solution and then dissect each component: &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_k60MffeGnb4/Som2iibpBHI/AAAAAAAAACA/vFv59C1hD8w/s1600-h/Full+SSIS+Package.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371024735090574450" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 373px" alt="" src="http://3.bp.blogspot.com/_k60MffeGnb4/Som2iibpBHI/AAAAAAAAACA/vFv59C1hD8w/s400/Full+SSIS+Package.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;div&gt;The SSIS package uses the following Package Variables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/Som3NX1sD0I/AAAAAAAAACQ/KI6MkMdMqj4/s1600-h/Package+Variables.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371025470981410626" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 129px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/Som3NX1sD0I/AAAAAAAAACQ/KI6MkMdMqj4/s400/Package+Variables.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;As we progress and dissect each SSIS task, we will look at each package variable it utilizes. The SSIS package uses a For Each container to cycle through each row present in the Source Table with the CurrentTable package variable holding the current table that needs to be extracted. Notice that we supplied an initial value for the CurrentTable. This way we can preview data in this table from the OLE DB Source connection we will see in the Data Flow task. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The package is fairly simple. It contains a highest level Sequence Container along with an inner For each Container. The For Each Container specifies an ADO Enumerator as its ‘Collection Type.’ The result set that feeds this container is below is produced by the Exec SQL Find Tables to Extract SSIS Task. The SQL Extract code is below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;select SourceTableName&lt;br /&gt;from dbo.SalesSource&lt;br /&gt;where ExtractProcessedFlag = 0&lt;br /&gt;order by ExtractProcessingOrder&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Notice that we are only extracting source tables where the ExractProcessedFlag is set to 0. The SSIS package sets this flag column to 1 when a source table is extracted. This EXEC SQL Task specifies the ResultSet Package Variable to ‘hold’ the results of the above select statement. (ResultSet is of type object)&lt;br /&gt;&lt;br /&gt;The For Each Container Specifies a ‘For each ADO Enumerator’ as the Collection type and points the ResultSet package variable as the result set holder. ( Notice the setting for the Enumerator and the ADO object Source variable choice)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_k60MffeGnb4/Som34FBPVLI/AAAAAAAAACY/XenBj6skmsY/s1600-h/foreachloopeditor.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371026204663960754" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 302px" alt="" src="http://3.bp.blogspot.com/_k60MffeGnb4/Som34FBPVLI/AAAAAAAAACY/XenBj6skmsY/s400/foreachloopeditor.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Also, the CurrentTable package variable is specified in the Variable Mappings tab. This allows our CurrentTable variable to essentially hold the current table being processed each time we cycle through the For Each loop. We'll see this package variable used in the expression that assigns a value to the SQLExtractCommand package variable.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/Som4mZ3w-ZI/AAAAAAAAACg/n4tSP7fB2JQ/s1600-h/for+each+variable+mapping.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371027000535349650" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/Som4mZ3w-ZI/AAAAAAAAACg/n4tSP7fB2JQ/s400/for+each+variable+mapping.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The Data Flow task specifies that the SQL to extact data is present in a Package Variable. While this choice if probably not the most common Data Access Mode choice, it does provide us with the flexiblity we need. This package variable has its value dynamically set using Expressions. If you choose a package variable and display its properties (F4 will provide the properties) you will notice that by default the &lt;em&gt;Evaluate As Expression&lt;/em&gt; property is False. This was changed to True as is seen below: &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_k60MffeGnb4/Som43GnQMGI/AAAAAAAAACo/9tx054TtBUA/s1600-h/SQLExtractComandProperties.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371027287423594594" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px" alt="" src="http://4.bp.blogspot.com/_k60MffeGnb4/Som43GnQMGI/AAAAAAAAACo/9tx054TtBUA/s400/SQLExtractComandProperties.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;If you click on the the ellipse in the Expression value, you will be provided with the expression builder dialog box. The SQLExtactCommand’s contents are created using the quoted string along with the CurrentTable package variable as seen below. (Notice I did specify square brackets to surrount the table name since the table name may include non-alphabetical or other strange characters) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_k60MffeGnb4/Som5MciMBCI/AAAAAAAAACw/kkZmiuzySOw/s1600-h/Expression+Builder.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371027654085182498" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 304px" alt="" src="http://1.bp.blogspot.com/_k60MffeGnb4/Som5MciMBCI/AAAAAAAAACw/kkZmiuzySOw/s400/Expression+Builder.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;I found it helpful to click on Evaluate Expression and then paste the results into a Management Studio window. This way you can execute and validate the actual code. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The Data Flow Task that specifies the SQLExtractCommand package variable is below. You will notice that you are able to view columns and even preview data because we supplied an initial value for our CurrentTable package variable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_k60MffeGnb4/Som6PpEe_CI/AAAAAAAAAC4/7pwA7WR941Q/s1600-h/OLE+DB+Source+Editor.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5371028808501492770" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 329px" alt="" src="http://4.bp.blogspot.com/_k60MffeGnb4/Som6PpEe_CI/AAAAAAAAAC4/7pwA7WR941Q/s400/OLE+DB+Source+Editor.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The final step in our SSIS package is a EXEC SQL statement that updates the source table to designate the SourceTable as being sucessfully processed. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;UPDATE&lt;br /&gt;dbo.SalesSource&lt;br /&gt;SET&lt;br /&gt;ExtractProcessedFlag = 1,&lt;br /&gt;DateTimeExtracted = getdate(),&lt;br /&gt;RowsExtracted = ?&lt;br /&gt;WHERE&lt;br /&gt;SourceTableName = ?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Parameters used in this update statement include the number of rows extracted from the source table along with the source table name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;What we left with is a SSIS package that extracts the tables to process from a source table. As new source tables arrive, we insert the rows into our source table without having to modify our SSIS package. &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-400731220084229146?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/400731220084229146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=400731220084229146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/400731220084229146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/400731220084229146'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/08/ssis.html' title='SSIS Dynamic Data Driven Extracts'/><author><name>JoeToscano</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_k60MffeGnb4/Som1u93flNI/AAAAAAAAAB4/bHbHLAtB0S8/s72-c/Source+Table+Contents.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-2240238788681770804</id><published>2009-08-04T15:46:00.002-04:00</published><updated>2009-08-04T15:48:21.898-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSMS'/><title type='text'>SQL 2008 SSMS Table Save Error</title><content type='html'>&lt;p&gt;Using SQL Server Management Studio (SSMS) for SQL 2008, I had to make a change to one of my tables to add a column. However, I did not want to add the column at the end of the table, I wanted to add the column between two other columns. When I attempted to Save the table change, I had the following error appear:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Bb_dqfXVtDU/SniP-sp24gI/AAAAAAAAAFM/JJM_FC99b_0/SSMS_Table_Save_Error%5B3%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="113" alt="SSMS_Table_Save_Error" src="http://lh3.ggpht.com/_Bb_dqfXVtDU/SniP_AHufSI/AAAAAAAAAFQ/OJrKHt-d2Lg/SSMS_Table_Save_Error_thumb%5B1%5D.jpg" width="453" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;In order to resolve this issue, I had to update the following setting in SSMS. Go to Tools--&amp;gt;Designers--&amp;gt;Table and Database Designers and uncheck the "Prevent saving changes that require table re-creation" checkbox:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Bb_dqfXVtDU/SniP_0X7PjI/AAAAAAAAAFU/e87X7BGHAkI/SSMS_Table_Designer_Option%5B10%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="301" alt="SSMS_Table_Designer_Option" src="http://lh5.ggpht.com/_Bb_dqfXVtDU/SniQAAR4fZI/AAAAAAAAAFY/iMkku8SfYb4/SSMS_Table_Designer_Option_thumb%5B8%5D.jpg" width="515" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-2240238788681770804?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/2240238788681770804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=2240238788681770804' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2240238788681770804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2240238788681770804'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/08/sql-2008-ssms-table-save-error.html' title='SQL 2008 SSMS Table Save Error'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_Bb_dqfXVtDU/SniP_AHufSI/AAAAAAAAAFQ/OJrKHt-d2Lg/s72-c/SSMS_Table_Save_Error_thumb%5B1%5D.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-3285391714945256743</id><published>2009-07-24T15:36:00.001-04:00</published><updated>2009-07-24T15:36:56.420-04:00</updated><title type='text'>Retrieve Web Page Results Using SSIS</title><content type='html'>&lt;h5&gt;Scenario&lt;/h5&gt;  &lt;p&gt;A client is wanting to use the web to retrieve coordinate information from Google Maps to store the information for a Marketing campaign.&lt;/p&gt;  &lt;h5&gt;Solution&lt;/h5&gt;  &lt;p&gt;The SSIS Script task can connect to the web page and return the results. The following script provides sample code on how to get the Script Task to perform the action. The script task was developed in SQL SSIS 2008 using VB, the 2005 version is similar but the guts of the HTTP code remains the same (thanks to my colleague Andrew Crowder for putting together the main syntax):&lt;/p&gt;  &lt;p&gt;First, a package is created with two variables of type String. The variables are passed into the script task in the following manner:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;ReadOnly: User::URL &lt;/li&gt;    &lt;li&gt;ReadWrite: User::HTML &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Now, the script itself:&lt;/p&gt;  &lt;p&gt;Imports System    &lt;br /&gt;Imports Microsoft.SqlServer.Dts.Runtime     &lt;br /&gt;Imports System.IO     &lt;br /&gt;Imports System.Net &lt;/p&gt;  &lt;p&gt;&amp;lt;System.AddIn.AddIn(&amp;quot;ScriptMain&amp;quot;, Version:=&amp;quot;1.0&amp;quot;, Publisher:=&amp;quot;&amp;quot;, Description:=&amp;quot;&amp;quot;)&amp;gt; _    &lt;br /&gt;&amp;lt;System.CLSCompliantAttribute(False)&amp;gt; _     &lt;br /&gt;Partial Public Class ScriptMain     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Enum ScriptResults    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Enum     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Public Sub Main()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Try &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'setup the variables, URL is set in the package as a var and read    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim URL As String = Dts.Variables(&amp;quot;URL&amp;quot;).Value     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim request As HttpWebRequest = WebRequest.Create(URL)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim response As HttpWebResponse = request.GetResponse()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim reader As StreamReader = New StreamReader(response.GetResponseStream()) &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'read the http data into a string to be used later in the package    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim str As String = reader.ReadToEnd() &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dts.Variables(&amp;quot;HTML&amp;quot;).Value = str.ToString() &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dts.TaskResult = ScriptResults.Success    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Catch ex As Exception     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'fire the info event and return as error from the task     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dts.Events.FireInformation(0, &amp;quot;Web Script Task&amp;quot;, ex.Message.ToString(), &amp;quot;&amp;quot;, 0, 0)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dts.TaskResult = ScriptResults.Failure     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Try     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Sub&lt;/p&gt;  &lt;h5&gt;Execution&lt;/h5&gt;  &lt;p&gt;The following URL value is set and returns the coordinate information into the HTML variable:&lt;/p&gt;  &lt;p&gt;URL: &lt;a href="http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;amp;output=csv&amp;amp;oe=utf8&amp;amp;sensor=false&amp;amp;key=ABQIAAAAP6yK9BJ44wmvT1Dd7V5cKRQz9eeYvRAhuPGO19pGZUf7Pj2DYxRZ0Zbtz0o1UAkk17kmD6xk5qDnzg"&gt;http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;amp;output=csv&amp;amp;oe=utf8&amp;amp;sensor=false&amp;amp;key=ABQIAAAAP6yK9BJ44wmvT1Dd7V5cKRQz9eeYvRAhuPGO19pGZUf7Pj2DYxRZ0Zbtz0o1UAkk17kmD6xk5qDnzg&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;HTML: 200,8,37.4219720,-122.0841430&lt;/p&gt;  &lt;p&gt;The script task can also return the HTML from a page, for example &lt;a href="http://www.rdacorp.com"&gt;http://www.rdacorp.com&lt;/a&gt;, and allow for other SSIS tasks to manipulate the HTML variable as per the requirements and design of the package as it would like any other variable within the package.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-3285391714945256743?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/3285391714945256743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=3285391714945256743' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3285391714945256743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3285391714945256743'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/07/retrieve-web-page-results-using-ssis.html' title='Retrieve Web Page Results Using SSIS'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6889378823343392077</id><published>2009-07-22T13:14:00.003-04:00</published><updated>2009-07-22T23:11:18.451-04:00</updated><title type='text'>Introduction to Excel Services</title><content type='html'>Microsoft and other software vendors offer a dizzying array of BI, business productivity, and data management tools from powerful relational databases on up. Yet research (and personal experience) has shown that a large number of corporations still maintain a significant quantity of business logic in plain-old Excel spreadsheets . Logic stored in spreadsheets can lead to a proliferation of cut-and-paste in an attempt at reuse that can become a maintenance nightmare. Responding to the needs of its customers, Microsoft introduced Excel Services for SharePoint Server 2007.&lt;br /&gt;&lt;br /&gt;Basically, Excel Services is a server-side version of the Excel calculation engine. Some common usage scenarios to Excel Services are:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A set of SharePoint web parts. This allows anyone with access to a SharePoint site to interact with Excel Data stored on a server without necessarily having full control to modify the data or change how it is presented. A Business Intelligence Dashboard showing KPIs (Key Performance Indicators) would be a common application. &lt;/li&gt;&lt;li&gt;An interactive spreadsheet viewer. Even if a customer has Excel installed on their workstation, this allows the user to view up-to-date Excel data without having to leave their browser when accessing their corporate SharePoint site &lt;/li&gt;&lt;li&gt;Maintaining “one version of the truth” of data (such as quarterly sales, etc.) on a server without having to worry about changes to multiple copies floating around individual users desktops. &lt;/li&gt;&lt;li&gt;A set of APIs for developers to leverage the calculation abilities of Excel from within their own applications. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;Architecturally, Excel Services is also divided into three components: &lt;/p&gt;&lt;ol&gt;&lt;li&gt; Excel Calculation Services (ECS) – handles the spreadsheet refresh and recalculation &lt;/li&gt;&lt;li&gt;Excel Web Access (EWA) – handles the rendering of the spreadsheet to the client, e.g. SharePoint site &lt;/li&gt;&lt;li&gt;Excel Web Services (EWS) – allows access to the Excel calculation engine via web service calls. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;Alas, Excel Services does not provide you with 100% of the full power of Excel to your SharePoint site; limitations include lack of support for VBA Macros, references to other Excel workbooks, ActiveX controls, and most graphical elements. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Excel Services may not be the most glamorous technology, and on the surface might seem like a “hack” – using a lowly spreadsheet to manage your important business data, and to provide the calculation engine for custom applications that might be better served by interfacing with a commercial or homegrown software library. However, in the real world of legacy systems and shrinking budgets, Excel Services has its place. In future blog entries, I will be diving in and exploring the different components of Excel Services in greater detail.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6889378823343392077?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6889378823343392077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6889378823343392077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6889378823343392077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6889378823343392077'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/07/introduction-to-excel-services.html' title='Introduction to Excel Services'/><author><name>Michael Izsak</name><uri>http://www.blogger.com/profile/02118212636031296004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-3016888080225801738</id><published>2009-07-22T10:46:00.003-04:00</published><updated>2009-07-22T10:49:26.173-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>Default Cube Action in Excel</title><content type='html'>&lt;h5&gt;Scenario&lt;/h5&gt;&lt;p&gt;When using Excel 2007 to connect to a SQL 2005\2008 SSAS cube, double-clicking a cell, or right clicking the cell and selecting Show Details, within a Pivot table brings up details about the specific sliced cell within the Pivot table. However, the default nature of the cube is to bring up the raw Fact table data for that slice, which displays all fields within the Fact table for the records that make up the cell. The fields within a Fact table are often surrogate keys that point to the Dimensions that join to the Fact table as well as all Measurements stored within the Fact table. This default nature is not the most helpful information to business analysts since the keys have no business meanings to the users.&lt;/p&gt;&lt;p&gt;The question then is how to change this default behavior to bring back information to supply meaningful details to a business analyst when using the cube. The answer is to create a Drillthrough Action with the SSAS cube and set the Default property to True. The Drillthrough Action will return the information that the business defines as meaningful when wanting to see the details within the cube.&lt;/p&gt;&lt;p&gt;The following lists out the steps on how to create the Drillthrough Action within the SSAS project for the cube and then demonstrates how to use the Drillthrough Action in an Excel Pivot Table.&lt;/p&gt;&lt;h5&gt;Setup the Drillthrough Action&lt;/h5&gt;&lt;p&gt;In the SSAS cube, navigate to the Action table and select the icon for the New Drillthrough Action:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Bb_dqfXVtDU/SmcmJ3NRuUI/AAAAAAAAAEk/v2NNhVbKUPk/SSAS_Drillthrough_Action%5B5%5D.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="77" alt="SSAS_Drillthrough_Action" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmKDRGJNI/AAAAAAAAAEo/TvSS61_TIVg/SSAS_Drillthrough_Action_thumb%5B3%5D.jpg" width="611" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;After selecting the New Drillthrough Action, setting up the what the Action should do is the next step. For this example, the AdventureWorks cube is being used to build the action and the example will return the following fields for the sliced cell as its default:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Reseller Sales Amount, Reseller Order Quantity &lt;/li&gt;&lt;li&gt;Date &lt;/li&gt;&lt;li&gt;City, State, Country &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The following screen prints lays out these fields and sets up the Default property to True:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Bb_dqfXVtDU/SmcmKrs9GvI/AAAAAAAAAEs/lnfvlLnB08I/SSAS_Drillthrough_Action_Setup%5B9%5D.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="405" alt="SSAS_Drillthrough_Action_Setup" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmK7aX12I/AAAAAAAAAEw/FXLVrRnH6SY/SSAS_Drillthrough_Action_Setup_thumb%5B7%5D.jpg" width="560" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h5&gt;&lt;/h5&gt;&lt;h5&gt;Using the SSAS Action&lt;/h5&gt;&lt;p&gt;After creating the action and processing the cube, an analyst can now connect to the cube via Excel 2007 and create a Pivot table as its starting report. For the example, the report is going to select Sales Territory by Calendar Year for Reseller Sales Amount. &lt;/p&gt;&lt;p&gt;With the Pivot setup, the following methods will display the the SSAS action, note these actions can only be performed on Non Calculated Members within the cube:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Double click the cell within the Pivot Table &lt;/li&gt;&lt;li&gt;Right click on the cell to drill into and select Show Details &lt;/li&gt;&lt;li&gt;Right click on the cell and select Additional Actions--&amp;gt;AW Default Action (this is the name of our Drillthrough Action in this example). &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Right Click--&amp;gt;Show Details Menu&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Bb_dqfXVtDU/SmcmLG5AjgI/AAAAAAAAAE0/Py0tehGkJsI/Excel_Show_Details%5B4%5D.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="241" alt="Excel_Show_Details" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmLU9d6KI/AAAAAAAAAE4/Ol710nF6GGo/Excel_Show_Details_thumb%5B2%5D.jpg" width="494" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Right Click--&amp;gt;Additional Actions Menu:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Bb_dqfXVtDU/SmcmLjoHM4I/AAAAAAAAAE8/ZGslQxja8lM/Excel_Additional_Actions%5B5%5D.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="204" alt="Excel_Additional_Actions" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmL7aTLuI/AAAAAAAAAFA/GAKd64PBY3A/Excel_Additional_Actions_thumb%5B3%5D.jpg" width="299" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h5&gt;Excel Report&lt;/h5&gt;&lt;p&gt;Regardless of the method chosen, Excel will create a new Tab within the Excel workbook and display the data as defined within the Drillthrough Action:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmMCyyXwI/AAAAAAAAAFE/RNUx4B7nmW0/Excel_Show_Details_Tab%5B10%5D.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="380" alt="Excel_Show_Details_Tab" src="http://lh5.ggpht.com/_Bb_dqfXVtDU/SmcmMVTwCdI/AAAAAAAAAFI/FM4-GNa3n-E/Excel_Show_Details_Tab_thumb%5B8%5D.jpg" width="763" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h5&gt;Conclusion&lt;/h5&gt;&lt;p&gt;As demonstrated, a Drillthrough Action within a SSAS cube is another tool for a business analyst to dive into their data and answer questions that is pertinent for the question at hand. Setting up a Drillthrough Action with the Default behavior set to True allows for the users to not see data that is meaningless to the users, since the users will not be able to translate surrogate keys to actual dimension text, but instead provides useful information to the analyst to help make business decisions. The tool of providing of this useful information is the point of developing the cube in the first place.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-3016888080225801738?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/3016888080225801738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=3016888080225801738' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3016888080225801738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3016888080225801738'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/07/default-cube-action-in-excel.html' title='Default Cube Action in Excel'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_Bb_dqfXVtDU/SmcmKDRGJNI/AAAAAAAAAEo/TvSS61_TIVg/s72-c/SSAS_Drillthrough_Action_thumb%5B3%5D.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4469252810541024386</id><published>2009-07-21T10:43:00.003-04:00</published><updated>2009-07-21T10:53:37.103-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Books'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='BI'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='business intelligence'/><title type='text'>A Toolkit book for your BI Toolbox</title><content type='html'>As part of a ramp-up plan to get more familiar with the latest Microsoft stack of BI tools and products, a colleague suggested I take a look at The Data Warehouse Toolkit by Ralph Kimball and  Margy Ross (ISBN 978-0471200246, on &lt;a href="http://www.amazon.com/Data-Warehouse-Toolkit-Complete-Dimensional/dp/0471200247/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1247601250&amp;amp;sr=8-1"&gt;Amazon&lt;/a&gt;). I am not going to provide a detailed synopsis of each chapter, you can check the key concepts listed in the text for that, but I want share some thoughts on how I found it useful and an interesting read as well. The book follows a case study format, which helps provide real-world context to the concepts being explained.&lt;br /&gt;&lt;br /&gt;If you are new to data warehousing, the first chapter provides all the background and vocabulary you need to get started. This chapter contains explanations and descriptions of facts, dimensions, measures, etc and draws parallels to relational concepts as well.&lt;br /&gt;&lt;br /&gt;A four-step design process is laid out early in Chapter 2 and referred to throughout the book. Key here is the notion to select a business process to model. Similar to other database or software development efforts, you need to start with the business requirements first. This is no different in a data warehouse design. The concepts of a data warehouse bus architecture and bus matrix are introduced in Chapter 3. While it’s not exactly the same as an Enterprise Service Bus, occasionally seen in a software solution, there are definitely some parallel ideas.&lt;br /&gt;&lt;br /&gt;The case studies in the early chapters start out simple and somewhat generic, but they help illustrate the basic design principals. The more complex case studies in later chapters still provide a good reference for more complex models, techniques, and industry specific scenarios.&lt;br /&gt;&lt;br /&gt;A chapter near the end of the book pulls it all together with a project lifecycle description to design and build a data warehouse. Here again, not too different from any other software development effort: gather requirements, design, implement, test, communicate with stakeholders, etc.&lt;br /&gt;&lt;br /&gt;Overall, I found the book very useful and plan to keep it handy as a companion reference. I was able to apply some of the modeling techniques directly in a solution leveraging Microsoft SQL Server 2008 Analysis Services, Integration Services and Reporting Services.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4469252810541024386?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4469252810541024386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4469252810541024386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4469252810541024386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4469252810541024386'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/07/toolkit-book-for-your-bi-toolbox.html' title='A Toolkit book for your BI Toolbox'/><author><name>Chris</name><uri>http://www.blogger.com/profile/06517951200558072779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5441067636453366919</id><published>2009-07-17T11:08:00.002-04:00</published><updated>2009-07-17T11:12:11.111-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>Using a View for a Fact Table in SSAS Project</title><content type='html'>&lt;p&gt;I recently was involved in building a custom data warehouse and 2005 SSAS cubes which contained many financial calculations off of the original data. Many of the calculations needed to be at the grain level of the warehouse before aggregations could be applied and therefore it made sense to perform these calculations as Named Calculations in the Data Source View (DSV). After the fields were added to the DSV, the new fields were added to the cube and then MDX calculated members were created in the cube for the final calculations to be consumed by the business users.&lt;/p&gt;&lt;p&gt;However, after many Named Calculations were added to the DSV, the performance of processing the SSAS partitions was becoming very poor and from looking at the SQL that the SSAS project was generating, it was clearly not optimized.&lt;/p&gt;&lt;p&gt;The solution was to create a database view that had the optimized SQL code containing the granular calculations and then within the DSV, replace the Fact table with the view. The following screen print displays the menu that appears by right clicking on the table to be replaced within the DSV and then navigating to the Replace Table\With Other Table option:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Bb_dqfXVtDU/SmCT7T3NBNI/AAAAAAAAAEU/DQUzxD0_5Ts/DS_Replace_Table%5B2%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="89" alt="DS_Replace_Table" src="http://lh5.ggpht.com/_Bb_dqfXVtDU/SmCT7pkCXWI/AAAAAAAAAEY/cWhXe-XgKJY/DS_Replace_Table_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The view also provided a benefit for the SSAS partitions that were created by being able to setup each partition as a SELECT * from VIEW WHERE &lt;em&gt;condition&lt;/em&gt;. The SELECT * allowed for more fields to be added to the view without having to go back into each SSAS partition and recreate the SQL that made up the partition for the additional field. Originally, all of the SSAS cube partitions had the non-optimized SQL code as the source and any additions to the FACT table would require going back to each partition and adding the new field to each and every partition created. Considering were had 150 partitions, this was not an enviable position to be going forward.&lt;/p&gt;&lt;p&gt;However, one property within the DSV needed to be changed to ensure that the DSV did not lose all of the relationships that were previously defined when originally using the Fact table itself. The warehouse had FK relationships amongst the Fact table and the many dimensions that joined to the Fact table. When the DSV was originally created, the relationships were read from the data source and automatically created. When replacing the table with a view, the relationships are not pointing to the view within the database and when you hit OK, you see all of your relationships disappear! &lt;/p&gt;&lt;p&gt;The fix for this problem is to change the DSV RetrieveRelationships property to False. The plus, you do not lose your relationships already defined in the DSV. The minus, you must manually create any new relationships that exist going forward, which is an acceptable task considering the many relationships that would have been lost and any future refreshing of the DSV would eliminate the relationships that were recreated.&lt;/p&gt;&lt;p&gt;The following screen print displays the location of the RetrieveRelationships property to update:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Bb_dqfXVtDU/SmCT76do9pI/AAAAAAAAAEc/BdKFGh8OnJ4/DSV_Properties%5B2%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="244" alt="DSV_Properties" src="http://lh5.ggpht.com/_Bb_dqfXVtDU/SmCT8MVIIVI/AAAAAAAAAEg/6fKIyDX80oM/DSV_Properties_thumb.jpg" width="234" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The final result of changing the Fact table from the warehouse with Named Calculations to a SQL Database View was being able to update the processing time for each partition from the SSAS generated query that was taking minutes to return to retrieving the same data within seconds by using the SQL Database View. In addition, we were able to improve the maintenance of the partitions for field updates from a painstaking manual update procedure and then a cube process to simply reprocessing the cube when field changes were made.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5441067636453366919?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5441067636453366919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5441067636453366919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5441067636453366919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5441067636453366919'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/07/using-view-for-fact-table-in-ssas.html' title='Using a View for a Fact Table in SSAS Project'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_Bb_dqfXVtDU/SmCT7pkCXWI/AAAAAAAAAEY/cWhXe-XgKJY/s72-c/DS_Replace_Table_thumb.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-3667541700582912788</id><published>2009-06-23T10:18:00.003-04:00</published><updated>2009-06-23T10:31:23.142-04:00</updated><title type='text'>Reporting Services and SharePoint - Context Expired Exception</title><content type='html'>&lt;strong&gt;Problem&lt;/strong&gt;&lt;br /&gt;At one of our client locations, developers and users complained of issues in accessing reports within SharePoint. The error was not occurring consistently. We quickly decided that since it wasn't happening every time, it may be a web-front-end (WFE) issue (as there are three WFEs  load-balanced together) . After thinking about this, we narrowed it down to one of the WFEs.&lt;br /&gt;&lt;br /&gt;When trying to open a report or even looking at a data source, SharePoint would throw an exception: "&lt;em&gt;Report Server has encountered a SharePoint error. ---&gt; Microsoft.SharePoint.SPException: The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317)&lt;/em&gt; " . The full error message is at the bottom of this post.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br /&gt;I tried the usual remedy steps such as IISRESET and rebooting the server. I then tried to repair the RS Add-In and even run the SharePoint Configuration Wizard. Nothing was working but I did notice in the logs that the timestamps were not the right time.&lt;br /&gt;&lt;br /&gt;After several other (almost) drastic actions, I decided to fix the clock on the server to have the correct time. Voila! This resolved the context issue and everything started working. The clock was so much different than any client machine that the security context was assumed to be expired.&lt;br /&gt;&lt;br /&gt;Sometimes a simple thing can cause major problems and sometimes major problems can be fixed by a simple solution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Full Error Message&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;System.Web.Services.Protocols.SoapException: Report Server has encountered a SharePoint error. ---&gt; Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: Report Server has encountered a SharePoint error. ---&gt; Microsoft.SharePoint.SPException: The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317) ---&gt; System.Runtime.InteropServices.COMException: The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317)   --- End of inner exception stack trace ---   at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.GetDataSourceContents(String DataSource, DataSourceDefinition&amp;amp; Definition)   at Microsoft.ReportingServices.WebServer.ReportingService2006.GetDataSourceContents(String DataSource, DataSourceDefinition&amp;amp; Definition) &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-3667541700582912788?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/3667541700582912788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=3667541700582912788' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3667541700582912788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3667541700582912788'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/06/reporting-services-and-sharepoint.html' title='Reporting Services and SharePoint - Context Expired Exception'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-371641895734647973</id><published>2009-06-05T11:42:00.002-04:00</published><updated>2009-06-05T12:06:45.276-04:00</updated><title type='text'>PerformancePoint Connection issues</title><content type='html'>I have been troubleshooting some PerformancePoint connection issues in setting up a new instance of PPS and, as you may or may not know, getting the configuration right can be a challenge. There's lots of good info online about setting up the Application Pool (&lt;a href="http://nickbarclay.blogspot.com/2007/11/pps-data-source-connection-problems.html"&gt;Nick Barclay has a particularly good post&lt;/a&gt;), but for those not familiar with certain applications, sometimes what's NOT said can give you fits.&lt;br /&gt;&lt;br /&gt;Case in point - when making identity changes to the App Pool, BE SURE TO RESET IIS or those changes aren't in effect. (Recycling the App Pool is not sufficient.)&lt;br /&gt;&lt;br /&gt;For those not familiar, the easiest way to cycle IIS is to open a command prompt and enter IISRESET. It's a quick process, but as always, be sure to coordinate with anyone else that may be using web services at that time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-371641895734647973?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/371641895734647973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=371641895734647973' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/371641895734647973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/371641895734647973'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/06/performancepoint-connection-issues.html' title='PerformancePoint Connection issues'/><author><name>Jim Pletscher</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-8673712347295648234</id><published>2009-06-02T10:13:00.008-04:00</published><updated>2009-06-02T11:18:31.641-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Report Viewer'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP Handlers'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>Coexistence of Report Viewer Versions 8.x and 9.x in SharePoint</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:verdana;"&gt;In one of our clients' SharePoint environments, both Report Viewer version 8.x and Report Viewer 9.x were installed. The assemblies can live together in the Global Assembly Cache (GAC) because of the different versions. The development team had created a custom reporting interface solution using the Report Viewer 9.x version(s) of the assemblies and controls. In order for the pages to render properly, an entry under HTTP Handlers within the web configuration (web.config) was required:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, &lt;strong&gt;Version=9.0.0.0&lt;/strong&gt;, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;This was fine. However, the SharePoint usage report page would not render because it requires the Version 8.0.0.0 HTTP Handler entry. The error message actually stated that that the line was missing. It wasn't missing, it was in there:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, &lt;strong&gt;Version=8.0.0.0&lt;/strong&gt;, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;It came first in the HTTP Handler section and we quickly realized that the last entry for the same path wins the battle. There seems to be no way of having two HTTP Handlers for the same path (which make sense). So in our case, either the custom reporting solution was broken or the Site Usage reports would not work; this would not be acceptable for long. &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:verdana;"&gt;I needed to find away to have both Version 8.0.0.0 and Version 9.0.0.0 work within the same web application. I tried various configuration settings and "hacks" in attempt to get it to work until finally I noticed something in the Reporting Services web config. There was some sort of an assembly redirect to tell IIS (ultimately) to use a different version of an assembly. It wasn't the assembly I was dealing with but I figured I may be able to use the same approach.&lt;br /&gt;&lt;br /&gt;Therefore, within the SharePoint web.config for port 80, I entered the following within the &amp;lt;runtime&amp;gt; &amp;lt;assembly binding&amp;gt; section under the &amp;lt;system.web&amp;gt; settings :&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;dependentAssembly&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;bindingRedirect &lt;strong&gt;oldVersion="8.0.0.0" &lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;newVersion="9.0.0.0"/&lt;/strong&gt;&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;/dependentAssembly&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;add type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" path="Reserved.ReportViewerWebControl.axd" verb="*"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Essentially, this was telling SharePoint that "if you are looking for the 8.0.0.0 version, use the 9.0.0.0 instead". This allowed the Site Usage page to at least render! It rendered with all of the web parts however the web parts all contained the same error message. They were now looking for the 9.0.0.0 version of the Microsoft.ReportViewer.ProcessingObjectModel assembly which didn't exist. I looked in the GAC and there was only the Version 8.0.0.0 in there. So I figured this was probably deprecated with the latest Report Viewer updates for SharePoint.&lt;br /&gt;&lt;br /&gt;So I decided to be tricky and use the same redirect for the Microsoft.ReportViewer.ProcessingObjectModel assembly but using the opposite version settings:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;dependentAssembly&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;assemblyIdentity name="Microsoft.ReportViewer.ProcessingObjectModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;bindingRedirect &lt;strong&gt;oldVersion="9.0.0.0"&lt;/strong&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;newVersion="8.0.0.0"&lt;/strong&gt;/&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;/dependentAssembly&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This actually worked! The Site Usage reports rendered and the development team's custom reporting interfaces were still functioning. We thought we were going to have to apply MOSS 2007 SP2 and/or SQL Server SP3 and worse case open a case ticket with Microsoft Support - not anymore!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-8673712347295648234?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/8673712347295648234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=8673712347295648234' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8673712347295648234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8673712347295648234'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/06/coexistence-of-report-viewer-versions.html' title='Coexistence of Report Viewer Versions 8.x and 9.x in SharePoint'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6173850691490248351</id><published>2009-05-14T16:47:00.001-04:00</published><updated>2009-05-14T16:47:25.848-04:00</updated><title type='text'>SSAS and Dynamic Excel Reports</title><content type='html'>&lt;p&gt;Excel can be a very powerful tool for allowing power users to analyze data in cubes.&amp;#160; However it is also possible to create dynamic reports using Excel.&amp;#160; This can be accomplished using &lt;a href="http://office.microsoft.com/en-us/excel/HA100830261033.aspx"&gt;Excel Cube functions&lt;/a&gt;.&amp;#160; Cube functions allow you to create the same type of functionality achieved in a pivot table but in a individual cell.&amp;#160; Then utilizing other Excel functions it is possible to parameterize the report making it dynamic.&lt;/p&gt;  &lt;p&gt;For this example, I will use one of the Adventures Works Cubes.&amp;#160; The first step is to create a pivot table that contains the information we want.&amp;#160; For this example I created a comparison of Internet Gross Profit sales for current month, prior month and the same month a year ago.&amp;#160; This data is further divided by primary sales territory.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_88umxTZ-ciA/SgyDURnsJ9I/AAAAAAAAAHk/e3JTEZ-yWIM/s1600-h/PivotTable3.jpg"&gt;&lt;img title="PivotTable" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="213" alt="PivotTable" src="http://lh4.ggpht.com/_88umxTZ-ciA/SgyDUlEpJVI/AAAAAAAAAHo/VeMdNeRlhu8/PivotTable_thumb1.jpg?imgmax=800" width="377" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Personally I found that using the Cube Functions in the formula editor to be complicated.&amp;#160; Thankfully there is a menu option in Excel 2007 that can help.&amp;#160; It is called ‘Convert to Formulas’ and is found in the PivotTable Tools –&amp;gt; OLAP Tools menu.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_88umxTZ-ciA/SgyDVu6J3NI/AAAAAAAAAHs/I1Z3kNUqVGg/s1600-h/ConvertToFormulas3.jpg"&gt;&lt;img title="ConvertToFormulas" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="148" alt="ConvertToFormulas" src="http://lh5.ggpht.com/_88umxTZ-ciA/SgyDWUKj_cI/AAAAAAAAAHw/QcKjNq5Nugg/ConvertToFormulas_thumb1.jpg?imgmax=800" width="427" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once this table has been converted we can analyze a few key cells to understand what is going on. The first is A3 where the measure is located. (All cell references relate to the image of the pivot table above.) This cell now contains the formula:&lt;/p&gt;  &lt;p&gt;=CUBEMEMBER(&amp;quot;AdventureWorksDW&amp;quot;,    &lt;br /&gt;&amp;quot;[Measures].[Internet Gross Profit]&amp;quot;)&lt;/p&gt;  &lt;p&gt;The function CUBEMEMBER allows you to select the measure.&amp;#160; If you edit the text you can select other measures, just delete all the text inside quote after this ‘[Measures].[’ and Excel will offer other options.&lt;/p&gt;  &lt;p&gt;The second cell we want to inspect is B8 (or any other value cell.)&lt;/p&gt;  &lt;p&gt;=CUBEVALUE(&amp;quot;AdventureWorksDW&amp;quot;,$A$3,$A8,B$7)&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;You can see that this cell just contains the name of the data source and references to other cells.&amp;#160; One thing to note is that not all cells that were in the pivot table are used by the cube functions so they can be deleted.&amp;#160; Here is my cleaned up table.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_88umxTZ-ciA/SgyDWkCPaHI/AAAAAAAAAH0/OpP77fA2xtc/s1600-h/ConvertedTable3.jpg"&gt;&lt;img title="ConvertedTable" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="200" alt="ConvertedTable" src="http://lh5.ggpht.com/_88umxTZ-ciA/SgyDW4tZOaI/AAAAAAAAAH4/85fu0l6mjG4/ConvertedTable_thumb1.jpg?imgmax=800" width="445" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The next step is to parameterize the dates reference in my converted table so that we can make the report dynamic.&amp;#160; Evaluating the cell D4 will help us do that.&lt;/p&gt;  &lt;p&gt;=CUBEMEMBER(&amp;quot;AdventureWorksDW&amp;quot;,&amp;quot;[Date].[Calendar].[Month].&amp;amp;[2004]&amp;amp;[5]&amp;quot;)&lt;/p&gt;  &lt;p&gt;You can see that the year and month number are used, however this will vary depending on how the time dimension in your cube is setup.&amp;#160; The first step is to place the date to drive the report into cell B1.&amp;#160; Then change the formulas in B4, C4, and D4 to use this date.&lt;/p&gt;  &lt;p&gt;I replaced the formulas in cells B4 and D4 with the ones below.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;B4: &lt;/strong&gt;=CUBEMEMBER(&amp;quot;AdventureWorksDW&amp;quot;, CONCATENATE(&amp;quot;[Date].[Calendar].[Month].&amp;amp;[&amp;quot;,YEAR(B1)-1,&amp;quot;]&amp;amp;[&amp;quot;,MONTH(B1),&amp;quot;]&amp;quot;))&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;D4: &lt;/strong&gt;=CUBEMEMBER(&amp;quot;AdventureWorksDW&amp;quot;,     &lt;br /&gt;CONCATENATE(&amp;quot;[Date].[Calendar].[Month].&amp;amp;[&amp;quot;,YEAR(B1),&amp;quot;]&amp;amp;[&amp;quot;,MONTH(B1),&amp;quot;]&amp;quot;))&lt;/p&gt;  &lt;p&gt;The only difference is we subtract 1 year from cell B4.&amp;#160; Cell C4 is a little more difficult because when the current month is January the prior month is December of the prior year.&amp;#160; If it is January the we need to add an if statement to see if we need to subtract 1 form the the year and set the month to 12.&amp;#160; If not we can just subtract 1 from the month number.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;C4: &lt;/strong&gt;=CUBEMEMBER(&amp;quot;AdventureWorksDW&amp;quot;, CONCATENATE(&amp;quot;[Date].[Calendar].[Month].&amp;amp;[&amp;quot;,IF(MONTH(B1)=1,YEAR(B1)-1,YEAR(B1)),&amp;quot;]&amp;amp;[&amp;quot;,IF(MONTH(B1)=1,12,MONTH(B1)-1),&amp;quot;]&amp;quot;))&lt;/p&gt;  &lt;p&gt;The final spreadsheet now looks like the image below but now the data in the table, which is pulled from the cube can be updated by changing the date in cell B2.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_88umxTZ-ciA/SgyDXCsoZOI/AAAAAAAAAH8/SbroKXqfVJo/s1600-h/PivotFinal3.jpg"&gt;&lt;img title="PivotFinal" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="192" alt="PivotFinal" src="http://lh3.ggpht.com/_88umxTZ-ciA/SgyDXcLtL9I/AAAAAAAAAIA/RmGDW42zOPc/PivotFinal_thumb1.jpg?imgmax=800" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is a straightforward example but could easily be expanded to handle more complex cases.&amp;#160; Graph data can also be updated using the same methodology.&amp;#160; So it is possible to see that this now gives you a complete report authoring environment that you can give to Excel power users and allow them to build their own reports from the cubes your organization has built.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6173850691490248351?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6173850691490248351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6173850691490248351' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6173850691490248351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6173850691490248351'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/05/ssas-and-dynamic-excel-reports.html' title='SSAS and Dynamic Excel Reports'/><author><name>Andrew Crowder</name><uri>http://www.blogger.com/profile/03742717900986525365</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_88umxTZ-ciA/SgyDUlEpJVI/AAAAAAAAAHo/VeMdNeRlhu8/s72-c/PivotTable_thumb1.jpg?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-1277428816036876839</id><published>2009-05-12T13:53:00.001-04:00</published><updated>2009-05-12T13:53:20.575-04:00</updated><title type='text'>Connecting to DB2 on AS/400 via OLE DB</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To connect to a DB2 database via OLE DB, you’ll need the&amp;#160; &lt;a href="http://go.microsoft.com/fwlink/?LinkId=123713&amp;amp;clcid=0x409" target="_blank"&gt;Microsoft OLEDB Provider for DB2&lt;/a&gt; (IBM also has one), which is part of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1&amp;amp;displaylang=en" target="_blank"&gt;Microsoft SQL Server 2008 Feature Pack&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;After installing the provider, there are several ways you can test connectivity: creating a &lt;a href="http://msdn.microsoft.com/en-us/library/e38h511e(VS.71).aspx" target="_blank"&gt;UDL&lt;/a&gt; file, using the “Data Access Tool” that ships with the Microsoft provider, or creating an OLE DB Connection in BIDS to name a few.&amp;#160; Below is a screen shot of the test connection’s property grid.&amp;#160; As you might expect, I’ve replaced the values of user id, IP address, schema, etc., with fake ones.&amp;#160; Properties to note are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;DBMS Platform: in my case, this is DB2\AS400 &lt;/li&gt;    &lt;li&gt;Default Schema: same as the library name in DB2.&amp;#160; Ex., the library name in the following query is “LIBNAME”: “SELECT * FROM LIBNAME.FILENAME” &lt;/li&gt;    &lt;li&gt;Package Collection: same as above &lt;/li&gt;    &lt;li&gt;Initial Catalog: Your AS/400 DBA should be able to provide this.&amp;#160; Or, if you have access to a linked server, expand it in SSMS and you should see the catalog name. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;At this point, my test connections were unsuccessful.&amp;#160; But the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=123713&amp;amp;clcid=0x409" target="_blank"&gt;Microsoft OLEDB Provider for DB2&lt;/a&gt; ships with a handy “SNA Trace Utility” that revealed more information:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VWZZ_o4YP0g/Sgm3hC9bPAI/AAAAAAAAAO4/3Q_2WHS5v-U/s1600-h/DB2PropertyGrid13.jpg"&gt;&lt;img title="DB2PropertyGrid" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="697" alt="DB2PropertyGrid" src="http://lh6.ggpht.com/_VWZZ_o4YP0g/Sgm3h-3NK5I/AAAAAAAAAO8/77_xQJ9FRrI/DB2PropertyGrid_thumb9.jpg?imgmax=800" width="304" align="right" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;|00000f50.000008b0 DDM&amp;#160;&amp;#160; 001B1153 E4E2C5D9 40C5E7C9 E340C4C5 D5C9C5C4 40C1C3C3 C5E2E2&amp;#160; &lt;br /&gt;|00000f50.000008b0 DRDA AR message: Name: RDBATHRM, Severity: Error, Diagnostic: USER EXIT DENIED ACCESS, Database: S1033BC1     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Notice the DRDA “DENIED ACCESS” message. Interestingly, the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=123713&amp;amp;clcid=0x409" target="_blank"&gt;Microsoft OLEDB Provider for DB2&lt;/a&gt; uses the &lt;a href="http://msdn.microsoft.com/en-us/library/ms945194.aspx" target="_blank"&gt;DRDA&lt;/a&gt; protocol.&amp;#160; Below is a screenshot from a 5250 session with the AS/400.&amp;#160; Notice the configuration setting “DDM / DRDA request access”, which is configured to reject all DDM / DRDA connections.&amp;#160; Changing this value to “*OBJAUT” resolved the issue.&amp;#160; For more information, see the &lt;a href="http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/cl/chgneta.htm" target="_blank"&gt;CHGNETA Command Description&lt;/a&gt; and look for DDMACC&amp;#160; (DDM / DRDA request access).&amp;#160; See also &lt;a href="http://support.microsoft.com/kb/246714" target="_blank"&gt;Microsoft KB article 246714&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VWZZ_o4YP0g/Sgm3i3hlczI/AAAAAAAAAPA/YWNSsg2xU-o/s1600-h/WIN5250.jpg"&gt;&lt;img title="WIN5250" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="499" alt="WIN5250" src="http://lh4.ggpht.com/_VWZZ_o4YP0g/Sgm3jy3neRI/AAAAAAAAAPE/pMmpOUDsltE/WIN5250_thumb.jpg?imgmax=800" width="705" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-1277428816036876839?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/1277428816036876839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=1277428816036876839' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1277428816036876839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/1277428816036876839'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/05/connecting-to-db2-on-as400-via-ole-db.html' title='Connecting to DB2 on AS/400 via OLE DB'/><author><name>Ben Black</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp1.blogger.com/_VWZZ_o4YP0g/SJUrCJ76_yI/AAAAAAAAAIc/PAhwg8X--jY/S220/benluk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_VWZZ_o4YP0g/Sgm3h-3NK5I/AAAAAAAAAO8/77_xQJ9FRrI/s72-c/DB2PropertyGrid_thumb9.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6782173006801096012</id><published>2009-05-01T16:29:00.002-04:00</published><updated>2009-05-01T16:36:05.201-04:00</updated><title type='text'>Non-Standard uses for SSIS Package Configurations</title><content type='html'>&lt;strong&gt;&lt;em&gt;by Joe Toscano, RDA&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL Server Integrations Services Package Configurations: Much more than dynamic connections &lt;/strong&gt;&lt;br /&gt;Package Configurations in SSIS allow you to dynamically change object property values such as a connection’s ConnectString simply by changing a row in a SSIS Package Configuration table or an XML Configuration File. They make your SSIS solution much more flexible in many ways and while connection strings are tops on the package configuration hit list, this blog entry discusses additional ways one can take advantage of SSIS Package Configurations.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why do we need Package Configurations?&lt;br /&gt;&lt;/strong&gt;Think about how this feature can be used. As your SSIS packages moves up the food chain from Development to Test and eventually to Production, you may need to change many package attributes along the way. Maybe while in TEST, your packages extracted sample data from a partial copy of the production data. Maybe while in TEST your package wrote to a TEST destination (SQL Instance), or FTP-ed files to a ftp development folder from an FTP TEST Site. Finally, maybe while in TEST your solution emailed a group of developers if there were any package failures. What if you thoroughly tested your SSIS solution in this environment and you are ready to move your solution into production?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Scary memories of DTS and package promotion / deployment&lt;br /&gt;&lt;/strong&gt;If you worked with SQL Server 2000’s DTS, one of the only ways to do deploy a package to a new server was while in the DTS Package Editor issue a Package à Save As and change the SQL Instance where the Package physically resides. Once this was done, in many cases you had to then manually change all of the connections to point to the correct product-mode sources and destinations. This was a painstakingly manual process. In many cases, many other package attributes needed to change in addition to sources and destinations. Enter SSIS Package Configurations. They allow you to modify rows in a Package Configuration Table or XML configuration file to achieve the same end-result.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How Package Configurations Work&lt;/strong&gt;&lt;br /&gt;While there are several types of Package Configurations in this example we have chosen to store our package configuration / dynamic values in a SQL Server table. Further, we have chosen to create a database called SSIS that contains our package configuration tables along with some other tables and stored procedures used by our auditing subsystem. SSIS allows you to define a Package Configuration Environment Variable, and we use this to store a connect string to the SQL Instance that houses this SSIS database. Our environment variable was called SSISPACKAGECONFIGURATIONS. We maintain multiple copies of the PackageConfiguration table each with different values to support the different environment. For example – we have one package configuration table that is used in my local development environment to point to my local SQL 2005 Developers Edition, while another was created for our shared test SQL Instance and yet another for our official production SQL Instance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Both standard and non-standard Package Configuration Examples&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;SSIS package Configurations are easily created in Business Intelligence Development Studio. (SSIS -&gt; Package Configurations)&lt;br /&gt;Let’s look at our package configuration categories and provide a typical Business Intelligence Development Studio (BIDS) Solution that utilizes them:&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;Source and Destination Connections and directories&lt;br /&gt;&lt;/strong&gt;SSIS Package configurations can be used to hold the connection strings for our connections to our SSIS, Stage and SalesDW databases which are databases used by our solution. In this solution, we are extracting monthly sales data from a FTP Site, so we can dynamically store the directories used to support this operation along with the FTP security credentials.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;a. SSIS, Stage and SalesDW OLEDB Connections&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;These represent standard OLEDB connections used by packages as either a source or destination. This may the most common use for package configurations. For these package configurations we choose to designate the ConnectString property of these connections making it the dynamic property we can easily change.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;b. FTP Working Directory&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Our solution uses an ftp .bat file and ftp scripts to drive the FTP get and put commands. We’ve found this gave us more flexibility than using the SSIS FTP task. This package variable designates the directory that houses the .bat and script files used by the FTP command. We had one location while our solution was in development, but in production our servers were clustered so we couldn’t reference a server’s local drive.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;c. FTP Local Directory, FTP Remote Directory&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Once connected to the FTP site you can change your local and remote directories using the lcd the cd commands. The local directory setting determined where files resided after they were gotten using the FTP mget command. As packages moved from development to test to production these did need to change so creating package variables whose values were package configuration items saved us on package maintenance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;d. SSIS Package Directory&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Initially this was set to the ‘working directory’ while we were working with the SSIS Solution in the Business Intelligence Development Studio. (In our case, the working directory was a SourceSafe local working directory setting) Once the packages were deployed to a production server, this changed in the package configuration table present in the production server to the actual deployment path on the production server. (for our solution, we stored our package files in the file system as opposed to in SQL Server)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. FTP Attributes&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;We’ve found that while in development mode we relied on a test FTP instance, but once our solution was deployed to production we were asked to use the official production site. All security credentials changed; therefore, storing these as package variables whose values were package configuration items saved us on package maintenance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;a. FTP Site Name, FTP Login, FTP Password &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;The FTP Security credentials were stored in package variables as package configuration items. This allows us to easily make changes without having to modify our SSIS Solution. Instead, we modified rows in the package configuration table.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;b. FileToExtract&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Our FTP site supported the use file wildcards (% matched any single character) and we were able designate the file to extract making the Year and Month (YYMM) portion of the file match any year and month. This way no matter what files were dropped to our FTP Site, our solution would auto-discover them and then extract and load them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;c. ParentTraceMode&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;We’ve found that while in development mode we actually wanted to the FTP results. What files did FTP get or what files did FTP move/rename. At first, this wasn’t possible because the FTP window appeared and disappeared too quickly since we were working with very small files. We decided to create a package variable called ParentTraceMode whose value is obtained from the calling parent using the Parent Package Configuration. If this value is set to 1, SSIS Precedence Constraints force the execution of a trace mode FTP command that simply does not provide the ending FTP quit statement. Sounds simple, but without the quit command the FTP window stays displayed for us to visually inspect. I found this trace flag also useful to direct the flow of the package to enable other tasks such as Script Tasks the display useful information via message boxes. Also, our FTP processing normally cleans up after itself by removing the FTP Script files that were just used. Good thing because there’s some sensitive security credentials in this file! With trace mode enable these script files remain in the FTP Working Directory for inspection.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Email Recipients&lt;br /&gt;&lt;/strong&gt;While in development our email recipients were hard-coded to be our development team members. As we got close production deployment, we realized there were many more interested parties; therefore, this list was changed to a package variable whose value was a package configuration.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;a. EmailRecipients&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Stores a semi-colon separated list of email recipients. This package variable is then passed to our stored procedure that sends out an SMTP Email notification.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Auditing Related Configurations&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The auditing subsystem uses package configurations extensively. Below one package configuration example:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;a. ParentPgkID&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Each package is assigned a unique identifier by the auditing subsystem. This is a parent package configuration (a package configuration value obtains from the calling or parent package) that allows track parent and child package execution hierarchy from our auditing tables. This has proven very useful since it is very common to have a master package whose job it is to execute all extract and load packages in the correct order – thereby producing an entire batch extract and run.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6782173006801096012?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6782173006801096012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6782173006801096012' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6782173006801096012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6782173006801096012'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/05/non-standard-uses-for-ssis-package.html' title='Non-Standard uses for SSIS Package Configurations'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-185240311336314031</id><published>2009-04-15T13:44:00.006-04:00</published><updated>2009-04-15T15:15:08.878-04:00</updated><title type='text'>Sales for past six months using SQL Pivot Operator</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Problem Statement&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;A simple revenue report needed to be generated that displays the summarized revenue dollars for each customer from a SalesDetail table. The YYMM column that holds the year and month ('0904' = April, 2009 ...). This YYMM column show be transposed and displayed as a column header in the report rather than have it display in each row of data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Background&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Each month, we get revenue new data that is appended to the SalesDetails table. At first, we simply modified the SQL Code that is generated the report data to include the new month's data. Each month our report got a bit wider, but it was nice to see all of our past data and new total revenue. Our client decided that they would rather have a no-maintenance solution that simply reports on the most recent 6 months (They didn't need to go back any further). This way they didn't have to make any report changes from month-to-month.&lt;br /&gt;&lt;br /&gt;Using PIVOT Operator, we had the report working by hard-coding each YYMM value, but we are looking for a solution without any hard-coding. Here is the sample of SQL using hard-coded YYMM values&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#3333ff;"&gt;SELECT&lt;br /&gt;             CustomerNumber,&lt;br /&gt;             CustomerName,&lt;br /&gt;             [0810] as 'Oct 2008 Revenue',&lt;br /&gt;            [0811] as 'Nov 2008 Revenue',&lt;br /&gt;            [0812] as 'Dec 2008 Revenue',&lt;br /&gt;            [0901] as 'Jan 2009 Revenue',&lt;br /&gt;            [0902] as 'Feb 2009 Revenue',&lt;br /&gt;             [0903] as 'Mar 2009 Revenue',&lt;br /&gt;            [0904] as 'Apr 2009 Revenue',&lt;br /&gt;            [0810] + [0811] + [0812] + [0901] + [0902] + [0903] + [0904] as 'Total Revenue'&lt;br /&gt;FROM&lt;br /&gt;           (SELECT&lt;br /&gt;                               CustomerNumber, CustomerName, Revenue, YYMM&lt;br /&gt;             FROM SalesDetails&lt;br /&gt;          ) SD&lt;br /&gt;        PIVOT&lt;br /&gt;        ( SUM(Revenue) FOR YYMM IN ([0810], [0811], [0812], [0901], [0902], [0903], [0904])) as pvt&lt;br /&gt;ORDER BY&lt;br /&gt;         CustomerNumber, CustomerName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Solution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;This problem can be solved using PIVOT operator and without Hard-coding the YYMM values, but getting the column names as mentioned in the sample SQL above could be difficult.&lt;br /&gt;&lt;br /&gt;PIVOT Operator works on fixed number of attribute values. Hence the number of values cannot be dynamic. Hence I tried work around this issue.&lt;br /&gt;&lt;br /&gt;Here is SQL to create the Table and load sample data&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE dbo.SalesDetails&lt;br /&gt;(&lt;br /&gt;YYMM CHAR(4) NULL,&lt;br /&gt;CustomerName VARCHAR(64) NULL,&lt;br /&gt;CustomerNumber VARCHAR(32) NULL,&lt;br /&gt;Revenue MONEY NULL&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;----- Sept 2008 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0809', 'Sears' ,'11111', $34.07)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0809', 'Sears' ,'11111', $24.07)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0809', 'Kmart' ,'22222', $41.11)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0809', 'Kmart' ,'22222', $1.78)&lt;br /&gt;--- Oct 2008 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0810', 'Sears' ,'11111', $34.99)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0810', 'Sears' ,'11111', $124.00)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0810', 'Sears' ,'11111', $11.11)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0810', 'Kmart' ,'22222', $61.78)&lt;br /&gt;--- Nov 2008 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0811', 'Sears' ,'11111', $84.39)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0811', 'Kmart' ,'22222', $124.00)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0811', 'Kmart' ,'22222', $11.11)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0811', 'Kmart' ,'22222', $61.78)&lt;br /&gt;--- Dec 2008 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0812', 'Sears' ,'11111', $2.99)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0812', 'Sears' ,'11111', $41.81)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0812', 'Kmart' ,'22222', $283.23)&lt;br /&gt;--- Jan 2009 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Sears' ,'11111', $2.99)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Sears' ,'11111', $41.81)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Kmart' ,'22222', $43.44)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Kmart' ,'22222', $10.34)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Kmart' ,'22222', $29.00)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0901', 'Kmart' ,'22222', $111.34)&lt;br /&gt;--- Feb 2009 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Sears' ,'11111', $2.99)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Sears' ,'11111', $41.81)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Kmart' ,'22222', $43.44)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Kmart' ,'22222', $10.34)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Kmart' ,'22222', $29.00)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0902', 'Kmart' ,'22222', $111.34)&lt;br /&gt;--- Mar 2009 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0903', 'Sears' ,'11111', $12.89)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0903', 'Sears' ,'11111', $21.81)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0903', 'Kmart' ,'22222', $33.40)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0903', 'Kmart' ,'22222', $110.94)&lt;br /&gt;--- Apr 2009 Sales&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0904', 'Sears' ,'11111', $14.89)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0904', 'Sears' ,'11111', $15.81)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0904', 'Kmart' ,'22222', $13.40)&lt;br /&gt;INSERT dbo.SalesDetails VALUES ('0904', 'Kmart' ,'22222', $156.94)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since PIVOT works on fixed set of Attributes, I used a CASE statement and passed parameters to segregate past 6 months data as [SIXTHMONTH], [FIFTHMONTH], [CURRENTMONTH] etc. I used this new fixed attributes in the PIVOT portion. Here is the solution&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;DECLARE @SixthLastMonth char(4)&lt;br /&gt;DECLARE @FifthLastMonth char(4)&lt;br /&gt;DECLARE @FourthLastMonth char(4)&lt;br /&gt;DECLARE @ThirdLastMonth char(4)&lt;br /&gt;DECLARE @SecondLastMonth char(4)&lt;br /&gt;DECLARE @LastMonth char(4)&lt;br /&gt;DECLARE @CurrentMonth char(4)&lt;br /&gt;&lt;br /&gt;SELECT @SixthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -6, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @FifthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -5, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @FourthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -4, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @ThirdLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -3, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @SecondLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -2, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @LastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -1, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @CurrentMonth = SUBSTRING(CONVERT(VARCHAR, GETDATE(), 12), 1,4)&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;CustomerNumber,&lt;br /&gt;CustomerName,&lt;br /&gt;ISNULL([SIXTHMONTH], 0.00) as 'Sixth Last Month Revenue',&lt;br /&gt;ISNULL([FIFTHMONTH], 0.00) as 'Fifth Last Month Revenue',&lt;br /&gt;ISNULL([FOURTHMONTH], 0.00) as 'Fourth Last Month Revenue',&lt;br /&gt;ISNULL([THIRDMONTH], 0.00) as 'Third Last Month Revenue',&lt;br /&gt;ISNULL([SECONDMONTH], 0.00) as 'Second Last Month Revenue',&lt;br /&gt;ISNULL([LASTMONTH], 0.00) as 'Last Last Month Revenue',&lt;br /&gt;ISNULL([CURRENTMONTH], 0.00) as 'Current Last Month Revenue',&lt;br /&gt;ISNULL([SIXTHMONTH], 0.00) + ISNULL([FIFTHMONTH], 0.00)&lt;br /&gt;+ ISNULL([FOURTHMONTH], 0.00) + ISNULL([THIRDMONTH], 0.00)&lt;br /&gt;+ ISNULL([SECONDMONTH], 0.00) + ISNULL([LASTMONTH], 0.00)&lt;br /&gt;+ ISNULL([CURRENTMONTH], 0.00) AS 'Total Revenue'&lt;br /&gt;FROM&lt;br /&gt;( SELECT&lt;br /&gt;CustomerNumber,&lt;br /&gt;CustomerName,&lt;br /&gt;Revenue,&lt;br /&gt;CASE YYMM&lt;br /&gt;WHEN @SixthLastMonth THEN 'SIXTHMONTH'&lt;br /&gt;WHEN @FifthLastMonth THEN 'FIFTHMONTH'&lt;br /&gt;WHEN @FourthLastMonth THEN 'FOURTHMONTH'&lt;br /&gt;WHEN @ThirdLastMonth THEN 'THIRDMONTH'&lt;br /&gt;WHEN @SecondLastMonth THEN 'SECONDMONTH'&lt;br /&gt;WHEN @LastMonth THEN 'LASTMONTH'&lt;br /&gt;WHEN @CurrentMonth THEN 'CURRENTMONTH'&lt;br /&gt;ELSE 'OTHER'&lt;br /&gt;END [YYMM]&lt;br /&gt;FROM SalesDetails&lt;br /&gt;) SD&lt;br /&gt;PIVOT&lt;br /&gt;( SUM(Revenue) FOR YYMM IN ( [SIXTHMONTH], [FIFTHMONTH], [FOURTHMONTH], [THIRDMONTH], [SECONDMONTH], [LASTMONTH], [CURRENTMONTH])&lt;br /&gt;) as pvt&lt;br /&gt;ORDER BY&lt;br /&gt;CustomerNumber, CustomerName&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This solves the issue of Hard-coding the YYMM values. But the column names will be like “Sixth Last Month Revenue” instead of “October 2008 Revenue”. Well this can be solved by tweaking the headings expression in the SSRS reports.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Alternate Solutions&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using SSRS reports&lt;/strong&gt;&lt;br /&gt;One can use PIVOT reports to solve this problem by filtering out sales which is older than six months. The column headings expression need to be tweaked to show the values like “October 2008 Revenues” etc. Here is the Sample Screen shot&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_NszYjBYumWY/SeYeoy-0o9I/AAAAAAAAAOg/1GU0QU_br-8/s1600-h/BI.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5324977295641060306" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 323px; CURSOR: hand; HEIGHT: 85px" alt="" src="http://4.bp.blogspot.com/_NszYjBYumWY/SeYeoy-0o9I/AAAAAAAAAOg/1GU0QU_br-8/s320/BI.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using Dynamic SQL&lt;br /&gt;&lt;/strong&gt;Dynamic SQL can be used to solve this issue too. Here is the code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#3333ff;"&gt;declare @ColNameSixth char(40), @ColNameFifth char(40), @ColNameFourth char(40), @ColNameThird char(40), @ColNameSecond char(40), @ColNameLast char(40), @ColNameCurrent char(40)&lt;br /&gt;&lt;br /&gt;select @ColNameSixth = datename(mm, dateadd(mm, -6, getdate())) + ' ' + cast(YEAR(dateadd(mm, -6, getdate())) as varchar) + ' Revenues'&lt;br /&gt;select @ColNameFifth = datename(mm, dateadd(mm, -5, getdate())) + ' ' + cast(YEAR(dateadd(mm, -5, getdate())) as varchar) + ' Revenues'&lt;br /&gt;select @ColNameFourth = datename(mm, dateadd(mm, -4, getdate())) + ' ' + cast(YEAR(dateadd(mm, -4, getdate())) as varchar) + ' Revenues'&lt;br /&gt;select @ColNameThird = datename(mm, dateadd(mm, -3, getdate())) + ' ' + cast(YEAR(dateadd(mm, -3, getdate())) as varchar) + ' Revenues'&lt;br /&gt;select @ColNameSecond = datename(mm, dateadd(mm, -2, getdate())) + ' ' + cast(YEAR(dateadd(mm, -2, getdate())) as varchar) + ' Revenues'&lt;br /&gt;select @ColNameLast = datename(mm, dateadd(mm, -1, getdate())) + ' ' + cast(YEAR(dateadd(mm, -1, getdate())) as varchar) + ' Revenue'&lt;br /&gt;select @ColNameCurrent = 'Current Revenues'&lt;br /&gt;&lt;br /&gt;DECLARE @SixthLastMonth char(4), @FifthLastMonth char(4),@FourthLastMonth char(4),@ThirdLastMonth char(4),@SecondLastMonth char(4),@LastMonth char(4),@CurrentMonth char(4)&lt;br /&gt;&lt;br /&gt;SELECT @SixthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -6, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @FifthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -5, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @FourthLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -4, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @ThirdLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -3, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @SecondLastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -2, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @LastMonth = SUBSTRING(CONVERT(VARCHAR, DATEADD(mm, -1, GETDATE()), 12), 1,4)&lt;br /&gt;SELECT @CurrentMonth = SUBSTRING(CONVERT(VARCHAR, GETDATE(), 12), 1,4)&lt;br /&gt;&lt;br /&gt;DECLARE @SQL NVARCHAR(4000)&lt;br /&gt;&lt;br /&gt;SELECT @SQL = '&lt;br /&gt;SELECT&lt;br /&gt;CustomerNumber,&lt;br /&gt;CustomerName,&lt;br /&gt;ISNULL([' + @SixthLastMonth + '], 0.00) as ''' + @ColNameSixth + ''',&lt;br /&gt;ISNULL([' + @FifthLastMonth + '], 0.00) as ''' + @ColNameFifth + ''',&lt;br /&gt;ISNULL([' + @FourthLastMonth + '], 0.00) as ''' + @ColNameFourth + ''',&lt;br /&gt;ISNULL([' + @ThirdLastMonth + '], 0.00) as ''' + @ColNameThird + ''',&lt;br /&gt;ISNULL([' + @SecondLastMonth + '], 0.00) as ''' + @ColNameSecond + ''',&lt;br /&gt;ISNULL([' + @LastMonth + '], 0.00) as ''' + @ColNamelast + ''',&lt;br /&gt;ISNULL([' + @CurrentMonth + '], 0.00) as ''Current Last Month Revenue'',&lt;br /&gt;ISNULL([' + @SixthLastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @FifthLastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @FourthLastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @ThirdLastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @SecondLastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @LastMonth + '], 0.00)&lt;br /&gt;+ ISNULL([' + @CurrentMonth + '], 0.00) AS ''Total Revenue''&lt;br /&gt;FROM&lt;br /&gt;( SELECT CustomerNumber, CustomerName, Revenue, [YYMM]&lt;br /&gt;FROM SalesDetails&lt;br /&gt;) SD&lt;br /&gt;PIVOT&lt;br /&gt;( SUM(Revenue) FOR YYMM IN ( [' + @SixthLastMonth + '], [' + @FifthLastMonth + '], [' + @FourthLastMonth + '], [' + @ThirdLastMonth + '], [' + @SecondLastMonth + '], [' + @LastMonth + '], [' + @CurrentMonth + '])) as pvt&lt;br /&gt;ORDER BY&lt;br /&gt;CustomerNumber, CustomerName&lt;br /&gt;'&lt;br /&gt;&lt;br /&gt;EXEC(@SQL)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-185240311336314031?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/185240311336314031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=185240311336314031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/185240311336314031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/185240311336314031'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/04/sales-for-past-six-months-using-sql.html' title='Sales for past six months using SQL Pivot Operator'/><author><name>Sarma Musty</name><uri>http://www.blogger.com/profile/04450720434203290103</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NszYjBYumWY/SeYeoy-0o9I/AAAAAAAAAOg/1GU0QU_br-8/s72-c/BI.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-9200878311777067329</id><published>2009-04-13T15:54:00.004-04:00</published><updated>2009-04-13T16:01:59.720-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RSClientPrint.cab'/><category scheme='http://www.blogger.com/atom/ns#' term='RSClientPrint.dll'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='Printing Reports'/><title type='text'>Reporting Services Print from SharePoint: "Unable to load client print control"</title><content type='html'>In an enterprise environment that doesn't allow users to download ActiveX controls, the printing of reports from within SharePoint may not work correctly as the IE Browser cannot load the client print control.&lt;br /&gt;&lt;br /&gt;We attempted to install the RSClientPrint.cab manually and register the DLLs but that didn't work. Even creating a new MSI file did not work. Finally, after going through various steps, we were able to allow the ActiveX controls to be silently installed within the locked-down environment. In order for the steps below to work, any group policy must "Allow download of signed ActiveX controls".  This was confirmed to be resolved using IE 6.0, 7.0, &amp;amp; 8.0.&lt;br /&gt;&lt;br /&gt;Here is the summary of our troubleshooting for issue “Unable to load client print control” :&lt;br /&gt;&lt;br /&gt;1.       When we tried to print any report from Sharepoint Integrated Reporting Services, we got an error “Unable to load client print control”.&lt;br /&gt;2.       We checked that Reporting Services is on 9.00.3042 (SP2) version.&lt;br /&gt;3.       Upgraded Report Server with Security Update for SQL Server 2005 Service Pack 2 (KB954606) : &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=4603C722-2468-4ADB-B945-2ED0458B8F47&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=4603C722-2468-4ADB-B945-2ED0458B8F47&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;4.       That went successful and Report Server version changed to 9.00.3073&lt;br /&gt;5.       Then we installed the updated version of the SharePointRS.msi on all Web Front Ends in the SharePoint farm. The new version of the add-in can be found here: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1e53f882-0c16-4847-b331-132274ae8c84&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=1e53f882-0c16-4847-b331-132274ae8c84&amp;amp;DisplayLang=en&lt;/a&gt;&lt;br /&gt;6.       Verified that the Microsoft.ReportingServices.SharePoint.UI.WebParts.dll has been updated to the correct build of 9.00.3294 by looking at the version of this file in  the C:\windows\assembly folder.&lt;br /&gt;7.  Now users are able to print the report&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-9200878311777067329?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/9200878311777067329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=9200878311777067329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9200878311777067329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9200878311777067329'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/04/reporting-services-print-from.html' title='Reporting Services Print from SharePoint: &quot;Unable to load client print control&quot;'/><author><name>Steve Mann</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/_gmYwAJepiK4/SM1bBH9vucI/AAAAAAAAAH8/_jaa4M3R52g/S220/mannsteve_2007.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-7848842005432030576</id><published>2009-02-27T08:57:00.005-05:00</published><updated>2009-02-27T09:35:28.465-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server BI scalability'/><title type='text'>BI 'Appliances', reference configurations, and very large-scale Data Warehouses</title><content type='html'>As a BI consultant, one thing I find interesting in the BI industry is talk of a Data Warehouse 'Appliance'. Sounds like something you plug in, turn on, and --bam-- instant data warehouse! Would be nice, but while that's not likely to happen, what is becoming available from the hardware vendors are preconfigured systems (aka, an appliance) that are designed for the demands of a data warehouse.&lt;br /&gt;&lt;br /&gt;Well, Microsoft has partnered with Dell and HP to pre-configure and pretest DW ‘reference’ configurations to compete with similar offerings from other big players. The thing I liked seeing was the ‘cost per terabyte’ - granted, these would be for very large implementations, but I thought this was an interesting reference to keep in the back of the mind for high-level scoping.&lt;br /&gt;&lt;br /&gt;According to a news article on TDWI.org ...&lt;br /&gt;“DW appliance pricing varies, but -- if Microsoft can come in at its $13,000-per-TB figure -- it can plausibly claim to field one of the cheaper DW appliance entries. On the other hand, "cheaper" in the DW appliance segment is something of a moving target. Prices have plummeted to such an extent that even DW powerhouse Teradata Corp. -- which appliance players Netezza Inc. and Dataupia Inc. like to position as a pricey proposition -- now markets a system (the Extreme Data 1550) that it says sells for about $16,500 per TB.” (Netezza sells a unit for $18,000 per TB)  (you can read more at &lt;a href="http://www.tdwi.org/News/display.aspx?ID=9325"&gt;http://www.tdwi.org/News/display.aspx?ID=9325&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;The other take away from this is that (for anyone still wondering) - yes - Microsoft SQL Server is truly an Enterprise-class BI platform or we wouldn't even be talking about them with the likes of Teradata and Netezza. Furthermore, the features that are planned for the next version of SQL Server as well as Project Madison mean that exciting things are still to come.&lt;br /&gt;&lt;br /&gt;For more info, check out -&lt;br /&gt;&lt;strong&gt;Project codename "Madison"&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/madison.aspx"&gt;http://www.microsoft.com/sqlserver/2008/en/us/madison.aspx&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;and for a slide-show about Project Madison...&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://sharepoint.microsoft.com/sharepoint/worldwide/us/southeast/Connections%20BUSINESS%20INTELLIGENCE/Connection%20SE%20Jan%202009%20-%20Madison%20Final.pptx"&gt;http://sharepoint.microsoft.com/sharepoint/worldwide/us/southeast/Connections%20BUSINESS%20INTELLIGENCE/Connection%20SE%20Jan%202009%20-%20Madison%20Final.pptx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-7848842005432030576?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/7848842005432030576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=7848842005432030576' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7848842005432030576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7848842005432030576'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/02/bi-appliances-reference-configurations.html' title='BI &apos;Appliances&apos;, reference configurations, and very large-scale Data Warehouses'/><author><name>Jim Pletscher</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-750673439911426511</id><published>2009-02-11T13:19:00.014-05:00</published><updated>2009-02-11T14:00:26.346-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSMS'/><category scheme='http://www.blogger.com/atom/ns#' term='Copy Results'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Management Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Include Column Headers in Query Result Export</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Good, bad, or otherwise, I spend a lot of time with my client executing ad-hoc SQL queries against our databases to retrieve data from our databases in order to assist with analysis. Many times this data is queried using SQL Server Management Studio (SSMS), copied\exported to Excel, then sent to appropriate team members for review.&lt;/span&gt; &lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Trebuchet MS;"&gt;The problem I've been having with this is that the column names (headers) aren't copied with the query results. This means I've been manually typing the column names in for my results. Not that big a deal when there is only a few columns included in my resultset, but when I need to report on 20-30 or so fields. What a waste of time!&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5301616097932129378" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 125px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_faKQOw930vs/SZMfwHy8tGI/AAAAAAAAABw/J3XPjfXAJgo/s320/Copy+Query+Results+Small.png" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5301615720664138786" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 121px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_faKQOw930vs/SZMfaKXQBCI/AAAAAAAAABo/Tl0oKL-37jQ/s320/Query+Results+No+Headers+Small.png" border="0" /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Trebuchet MS;"&gt;I've tried sending the query results to "Text", as opposed to the "Grid", but that doesn't seem to make it much easier on me. After some poking around, I found the "&lt;strong&gt;Include column headers when copying or saving the results&lt;/strong&gt;" option. It's located here:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;Tools &gt; Options&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:Trebuchet MS;"&gt;Query Results &gt; SQL Server &gt; Results to Grid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5301612492598759618" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 190px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_faKQOw930vs/SZMceQ4fUMI/AAAAAAAAABQ/TxhZN5lqWmU/s320/Include+column+headers+option.png" border="0" /&gt;&lt;br /&gt;With this option selected, I can now copy (or directly save) data from my query results (in Grid) and have the column headers included saving me the effort of typing the column names in for each resultset I need to provide.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5301615294153715970" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 382px; CURSOR: hand; HEIGHT: 128px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_faKQOw930vs/SZMfBVfPcQI/AAAAAAAAABg/n0IAOJUEtVE/s320/Query+Results+With+Headers+Small.png" border="0" /&gt;&lt;br /&gt;&lt;div&gt;As you might have picked up on from the screenshots, I experience this in SSMS 2005 with basically the default settings. I don't have a SQL Server 2008 box readily available to see if this option is still unselected by default, but I sure hope it isn't. I know, going forward, this will be one of the first defaults to be switched on any SSMS installations I own.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-750673439911426511?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/750673439911426511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=750673439911426511' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/750673439911426511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/750673439911426511'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/02/include-column-headers-in-query-result.html' title='Include Column Headers in Query Result Export'/><author><name>Brian McCullough</name><uri>http://www.blogger.com/profile/03631616681884901656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_faKQOw930vs/SZMfwHy8tGI/AAAAAAAAABw/J3XPjfXAJgo/s72-c/Copy+Query+Results+Small.png' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6297780415491914293</id><published>2009-01-12T11:46:00.001-05:00</published><updated>2009-01-12T11:46:21.802-05:00</updated><title type='text'>Advanced Dimension Data Security with SQL Server 2008</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;On a recent project, my client asked if we could secure members of a dimension by Active Directory groups.&amp;#160; For example, in a dimension named “Region”, there might be a “Southeast” region.&amp;#160; Members of the A/D group named Southeast should only be able to view the “Southeast” member. Below is an example of this, built using the AdventureWorks database.&amp;#160; In this example, the Geography dimension is secured.&lt;/p&gt;  &lt;h3&gt;The Dimensional Model &lt;/h3&gt;  &lt;blockquote&gt;&lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;The goal is that when a client application (like Excel) issues the below query, Analysis Services returns only specific geographies the user is authorized to view.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;/p&gt;    &lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:76f764ec-ae01-4a77-8319-8e39251c4a99" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;SELECT&lt;br /&gt;[Measures].[Sales Amount] ON COLUMNS,&lt;br /&gt;[Geography].[City].MEMBERS ON ROWS&lt;br /&gt;FROM [Adventure Works DW2008]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;To secure the Geography dimension, two additional tables are added to the model: FactGeographySecurity and DimUser.&amp;#160;&amp;#160; Here’s the DDL:&lt;/p&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:ed2aea5c-db3f-42bc-8929-84b432fd6c9a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimUser](&lt;br /&gt;	[UserKey] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;	[UserName] [varchar](50) NULL,&lt;br /&gt;	CONSTRAINT [PK_DimUser] PRIMARY KEY CLUSTERED &lt;br /&gt;	(&lt;br /&gt;		[UserKey] ASC&lt;br /&gt;	)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[FactGeographySecurity](&lt;br /&gt;	[UserKey] [int] NOT NULL,&lt;br /&gt;	[GeographyKey] [int] NOT NULL,&lt;br /&gt;	CONSTRAINT [PK_FactDistrictSecurity] PRIMARY KEY CLUSTERED &lt;br /&gt;	(&lt;br /&gt;		[UserKey] ASC,&lt;br /&gt;		[GeographyKey] ASC&lt;br /&gt;	)&lt;br /&gt;)&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;Now insert some test data into the new tables.&amp;#160; The below DML adds my user account, and then grants me access to cities in Great Britain and Canada.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:9b37f896-ba90-4a1f-ba03-61f21fd0d49b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;INSERT DimUser (UserName) VALUES('blackd820\black')&lt;br /&gt;&lt;br /&gt;INSERT FactGeographySecurity (UserKey, GeographyKey)&lt;br /&gt;	SELECT &lt;br /&gt;		(SELECT UserKey FROM DimUser WHERE UserName = 'blackd820\black')&lt;br /&gt;		,GeographyKey&lt;br /&gt;	FROM DimGeography&lt;br /&gt;	WHERE CountryRegionCode IN ('GB', 'CA')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;In BIDS, add the DimGeography, DimReseller, and FactResellerSales tables to your Data Source View from the AdventureWorksDW database.&amp;#160; Also add the two new tables, DimUser and FactGeographySecurity.&lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;img title="clip_image001" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="456" alt="clip_image001" src="http://lh3.ggpht.com/_VWZZ_o4YP0g/SWtzyRTyhEI/AAAAAAAAAN4/3kD5Cy2fnIM/clip_image001_thumb%5B2%5D.png?imgmax=800" width="399" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;Create database/cube dimensions for Geography, Reseller, and User.&amp;#160; Create Reseller Sales and Geography Security measure groups.&amp;#160; Your cube structure should now look like the below:&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="466" alt="image" src="http://lh3.ggpht.com/_VWZZ_o4YP0g/SWtzzEnjFnI/AAAAAAAAAN8/9VqkWlqIyWw/image_thumb%5B1%5D.png?imgmax=800" width="476" border="0" /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Applying Security&lt;/h3&gt;&lt;blockquote&gt; &lt;p&gt;In BIDS, create a new role.&amp;#160; Mine is named “DimensionSecurity”.&amp;#160;&amp;#160; On the “Membership” Tab add your user account (I added my “black” account).&amp;#160; On the “Dimension Data” Tab, open the “Advanced” sub-tab.&amp;#160; Select the “Geography” dimension, and the “City” attribute.&amp;#160; Then type the below MDX expression into the “Allowed member set” text box.&amp;#160;&amp;#160; You can also check “Enable Visual Totals” here if totals should be tallied based on the filtered set, not the entire set.&lt;/p&gt; &lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:52131339-7753-4d76-81f7-8a406653e54e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Exists([Geography].[City].MEMBERS,StrToMember("[User].[User Name].&amp;[" + Username + "]"), "Geography Security")&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/ms144936.aspx"&gt;exists function&lt;/a&gt; returns a set that is based on filtering the first set by members of the second set.&amp;#160; And because the “Geography Security” measure group is specified, the second set, [User].[User Name].&amp;amp;[black], must also have associated rows in the FactGeographySecurity fact table.&amp;#160; Now it should make sense why we added FactGeographySecurity as a measure group, and DimUser as a dimension.&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160;&lt;strong&gt;Note:&lt;/strong&gt; this only secures the City attribute.&amp;#160; For each attribute in the drop-down list, type in an allowed member set similar to the one above.&amp;#160; Only the first parameter would change.&amp;#160; Ex., for the Country-Region attribute, the first parameter becomes [Geography].[Country-Region].MEMBERS.&lt;/p&gt;&lt;/blockquote&gt;&lt;br/&gt;&lt;h3&gt;Testing in BIDS&lt;/h3&gt;&lt;blockquote&gt;In BIDS, go to the cube browser, and click the “Change User” icon &lt;a href="http://lh3.ggpht.com/_VWZZ_o4YP0g/SWtzzo1xxTI/AAAAAAAAAOA/cuG0RXvYHS8/s1600-h/image%5B29%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="31" alt="image" src="http://lh4.ggpht.com/_VWZZ_o4YP0g/SWtz0adbrFI/AAAAAAAAAOE/ZYnEDedMpUE/image_thumb%5B17%5D.png?imgmax=800" width="30" border="0" /&gt;&lt;/a&gt;.&amp;#160; Select the “Roles” option, and choose “DimensionSecurity” from the drop-down list.&amp;#160; Expand Geography and drag the City attribute into the rows area.&amp;#160; Drag any measure from Reseller Sales into the totals area.&amp;#160; You should see, as in the below, that only cities from Great Britain and Canada are displayed.&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VWZZ_o4YP0g/SWtz1YNjYzI/AAAAAAAAAOI/aFygLk_s8Cs/s1600-h/image%5B33%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="545" alt="image" src="http://lh6.ggpht.com/_VWZZ_o4YP0g/SWtz25IXq1I/AAAAAAAAAOM/cEtdI3xCEuo/image_thumb%5B19%5D.png?imgmax=800" width="853" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;Testing via MDX&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;Run the below MDX script in SSMS.&amp;#160; Notice how the “Allowed member set” MDX from above is used on the row axis, with the username hardcoded.&amp;#160; This might be useful if you just want to verify that the dimension/fact data is setup correctly.&amp;#160; &lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:2e682426-7e49-40a4-b308-3a5420f6dcb8" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;SELECT &lt;br /&gt;[Measures].[Sales Amount] ON COLUMNS, &lt;br /&gt;Exists([Geography].[City].MEMBERS,StrToMember("[User].[User Name].&amp;[blackd820\black]"), "Geography Security") ON ROWS &lt;br /&gt;FROM [Adventure Works DW2008]&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h3&gt;&amp;#160;&lt;/h3&gt;&lt;h3&gt;Testing in Excel 2007&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;When connecting via Excel, you might expect it to just work.&amp;#160; After all, your account is in the “DimensionSecurity” role.&amp;#160; But if you are a server administrator, you will still see all of the City members, not just ones for Great Britain and Canada. But similar to the way you explicitly chose “DimensionSecurity” in the BIDS cube browser, you can test other roles by listing them (comma-delimited if more than one) in the connection string:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Data Source=blackd820;Initial Catalog=SSAS Security;&lt;span style="background-color: yellow"&gt;Roles=DimensionSecurity&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;To do this, (I’m using Excel 2007), go to the “Data” tab and select “Properties”.&amp;#160; You’ll find the connection string on the “Definition” tab.&amp;#160; Add the part highlighted in yellow above.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you’ve only set security on the “City” attribute, expand “More fields” and select “City” from the PivotTable Field List pane.&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/h3&gt;&lt;br/&gt;&lt;h3&gt;Populate the security table from Active Directory&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;You probably noticed that security is defined in the FactGeographySecurity table at the grain of the individual user, instead of the Active Directory role.&amp;#160; This is because there is no IsUserInRole MDX function.&amp;#160; So now we have to maintain data in the FactGeographySecurity table to keep it in sync with Active Directory.&amp;#160; To do this, we need a way to query an A/D group and return a list of users.&amp;#160; &lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;A utility application scheduled to execute nightly could be written to accomplish this.&amp;#160; The code snippet below retrieves a list of users in the specified A/D group; this list could be used to insert records into FactGeographySecurity.&amp;#160; &lt;/p&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:2e27a3b7-8963-41e8-9d2b-63035d5a823c" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: hidden; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// Gets a list of members in the specified group.&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        public static List&lt;DirectoryEntry&gt; GetGroupMembers(string groupName)&lt;br /&gt;        {&lt;br /&gt;            List&lt;DirectoryEntry&gt; users = new List&lt;DirectoryEntry&gt;();&lt;br /&gt;&lt;br /&gt;            string domain = "somedomain.com";&lt;br /&gt;            string filter = string.Format("(&amp;(ObjectClass={0})(sAMAccountName={1}))", "group", groupName); // principal);&lt;br /&gt;            string[] properties = new string[] { "fullname" };&lt;br /&gt;            DirectoryEntry adRoot = new DirectoryEntry("LDAP://" + domain, null, null, AuthenticationTypes.Secure);&lt;br /&gt;            DirectorySearcher searcher = new DirectorySearcher(adRoot);&lt;br /&gt;            searcher.SearchScope = SearchScope.Subtree;&lt;br /&gt;            searcher.ReferralChasing = ReferralChasingOption.All;&lt;br /&gt;            searcher.PropertiesToLoad.AddRange(properties);&lt;br /&gt;            searcher.Filter = filter;&lt;br /&gt;            SearchResult result = searcher.FindOne();&lt;br /&gt;&lt;br /&gt;            if (result != null)&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;                DirectoryEntry directoryEntry = result.GetDirectoryEntry();&lt;br /&gt;                foreach (object dn in directoryEntry.Properties["member"])&lt;br /&gt;                {&lt;br /&gt;                    DirectoryEntry member = new DirectoryEntry("LDAP://" + dn);&lt;br /&gt;&lt;br /&gt;                    //Add users from other groups within this group (only go 1 level deep).&lt;br /&gt;                    if (!IsGroup(member))&lt;br /&gt;                    {&lt;br /&gt;                        users.Add(member);&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return users;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// Determine whether the object is a group.&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        private static bool IsGroup(DirectoryEntry de){&lt;br /&gt;            return de.Properties["objectClass"][1].ToString() == "group";&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;Finally&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;Using this approach, each dimension can be secured by creating &lt;strong&gt;only a single role&lt;/strong&gt;.&amp;#160; This satisfied my client,&amp;#160; who did not want to manually create a role per geography, then go into the role definition and manually select dimensions available to that role. &lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;Hope this helps!&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6297780415491914293?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6297780415491914293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6297780415491914293' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6297780415491914293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6297780415491914293'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/01/advanced-dimension-data-security-with.html' title='Advanced Dimension Data Security with SQL Server 2008'/><author><name>Ben Black</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp1.blogger.com/_VWZZ_o4YP0g/SJUrCJ76_yI/AAAAAAAAAIc/PAhwg8X--jY/S220/benluk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_VWZZ_o4YP0g/SWtzyRTyhEI/AAAAAAAAAN4/3kD5Cy2fnIM/s72-c/clip_image001_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5360883743953289181</id><published>2009-01-10T08:16:00.004-05:00</published><updated>2009-01-10T08:25:22.471-05:00</updated><title type='text'>SSIS Error from DTEXEC: Login timeout expired</title><content type='html'>When executing an SSIS package that is stored in the MSDB database (i.e. stored in SQL Server) you may experience an error message like this:&lt;br /&gt;&lt;br /&gt;Could not load package "\PACKAGENAME" because of error 0xC0014062.Description: The LoadFromSQLServer method has encountered OLE DB error code 0x80004005 (Login timeout expired).  The SQL statement that was issued has failed.&lt;br /&gt;&lt;br /&gt;In my situation the SQL Server database where the SSIS package is deployed is a named instance.  There is no default SQL Server instance on the server.  The command line that I used to execute the package was:&lt;br /&gt;&lt;br /&gt;DTEXEC /SQL "\PACKAGENAME"&lt;br /&gt;&lt;br /&gt;The problem is that the above command is trying to load the SSIS package from the MSDB database in the default instance of SQL Server and there isn't one.  The solution is quite simple; add the /SERVER command line parameter with the server\instance of the SQL Server; e.g.&lt;br /&gt;&lt;br /&gt;DTEXEC /SQL "\ADSECURITYSYNC" /SERVER "SERVERNANE\INSTANCENAME"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5360883743953289181?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5360883743953289181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5360883743953289181' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5360883743953289181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5360883743953289181'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/01/ssis-error-from-dtexec-login-timeout.html' title='SSIS Error from DTEXEC: Login timeout expired'/><author><name>Raymond Barley</name><uri>http://www.blogger.com/profile/03710057857648484324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/-siy09nRaLbA/Tvy27jYRgWI/AAAAAAAAAGg/YuNN-C8TgCs/s220/IMG-20111227-00133.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-8406520326179460211</id><published>2009-01-09T14:42:00.002-05:00</published><updated>2009-01-09T14:43:51.387-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>Dynamic Set for MDX Calculations</title><content type='html'>&lt;h4&gt;PROBLEM&lt;/h4&gt;&lt;p&gt;I have been running into a problem trying to get the MIN, MAX and MEDIAN MDX calculations to work against a dynamic set as opposed to setting a static set in these Calculated Members in my cube. However, there was a wrinkle to my problem, the dynamic set would go across attributes of the same dimension and this is where I was running into problems.&lt;/p&gt;&lt;p&gt;For simplicity, I have the following tables in my warehouse: LOAN, GEOGRAPHY, LOAN_FACT, TIME&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In the LOAN, I have an ID and a LOADING SYS field. The LOADING SYS field describes what source system the Loan came from&lt;/li&gt;&lt;li&gt;In the Geography table, I have a Geography ID and Geography Name (very simplistic for this post)&lt;/li&gt;&lt;li&gt;In the LOAN_FACT, I have the Loan Id, Geography Id, Time Id and EOM BAL.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;When I create my cube, the LOAN FACT table is the FACT table and the other tables are the Dimensions of the cube.&lt;/p&gt;&lt;p&gt;So far, so simple. &lt;/p&gt;&lt;p&gt;Now, I want to create calculated members within the cube that gives me the MIN, MAX, and MEDIAN EOM BAL across whatever is selected by the user with the understanding one principal, the LOADING SYS is a very important breakdown of the data.&lt;/p&gt;&lt;h4&gt;SOLUTION TAKE 1&lt;/h4&gt;&lt;p&gt;I started with the following calculation:&lt;/p&gt;&lt;p&gt;CREATE MEMBER CURRENTCUBE.[MEASURES].[EOM BAL MIN] AS&lt;/p&gt;&lt;p&gt;MIN([LOAN].[LOAN].children, [MEASURES].[EOM BAL]) &lt;/p&gt;&lt;p&gt;Then a select statement like the following would be expected to give me my result:&lt;/p&gt;&lt;p&gt;SELECT [MEASURES].[EOM BAL MIN] on COLUMNS,&lt;/p&gt;&lt;p&gt;NON EMPTY(&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;[GEOGRAPHY].[GEOGRAPHY NAME].CHILDREN *&lt;/p&gt;&lt;p&gt;[LOAN].[LOADING SYS].CHILDREN&lt;/p&gt;&lt;p&gt;) on ROWS&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;FROM [LOAN CUBE]&lt;/p&gt;&lt;p&gt;However, this did not work as it went through and game me the lowest EOM BAL for every loan within a Geography regardless of the LOADING SYS and then repeated that value for each LOADING SYS even if the LOADING SYS did not exist for a GEOGRAPHY. A Really Bad Answer!&lt;/p&gt;&lt;h4&gt;SOLUTION TAKE 2&lt;/h4&gt;&lt;p&gt;Taking another stab at the calculation, I updated it to read:&lt;/p&gt;&lt;p&gt;CREATE MEMBER CURRENTCUBE.[MEASURES].[EOM BAL MIN] AS&lt;/p&gt;&lt;p&gt;MIN(DESCENDANTS([LOAN].[LOAN].CURRENTMEMBER,,LEAVES), [MEASURES].[EOM BAL]) &lt;/p&gt;&lt;p&gt;This answer came close as it would give me the lowest loan value within a GEOGRAPHY and only present those LOADING SYS values that actually existed. However, it would still only give me the MIN EOM BAL within the GEOGRAPHY regardless of the LOADING SYS, so it still was incorrect.&lt;/p&gt;&lt;h4&gt;CORRECT SOLUTION&lt;/h4&gt;&lt;p&gt;After a little research, I found that I could setup my CURRENT LOADING SYS as a CALCUALTED MEMBER against the MEASURES Parent Hierarchy. Once I had that, I could setup my LOAN set to use this member. The following two CALCULATED MEMBERS were then created and viola, my answer that I wanted:&lt;/p&gt;&lt;p&gt;CREATE MEMBER CURRENTCUBE.[MEASURES].[CURRENT LOADING SYS] AS&lt;/p&gt;&lt;p&gt;[LOAN].[LOADING SYS].CURRENTMEMBER.NAME&lt;/p&gt;&lt;p&gt;CREATE MEMBER CURRENTCUBE.[MEASURES].[EOM BAL MIN] AS&lt;br /&gt;      MIN(&lt;br /&gt;             (DESCENDANTS([LOAN].[LOAN].CURRENTMEMBER,,LEAVES),  IIF([MEASURES].[CURRENT LOADING SYS] = 'ALL', [MEASURES].[CURRENT LOADING SYS], STRTOMEMBER([MEASURES].[CURRENT LOADING SYS]))),&lt;br /&gt;             [MEASURES].[EOM BAL])&lt;/p&gt;&lt;p&gt;Now, if I run the following again:&lt;/p&gt;&lt;p&gt;SELECT [MEASURES].[EOM BAL MIN] on COLUMNS,&lt;/p&gt;&lt;p&gt;NON EMPTY(&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;[GEOGRAPHY].[GEOGRAPHY NAME].CHILDREN *&lt;/p&gt;&lt;p&gt;[LOAN].[LOADING SYS].CHILDREN&lt;/p&gt;&lt;p&gt;) on ROWS&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;FROM [LOAN CUBE]&lt;/p&gt;&lt;p&gt;What I return is the MIN EOM BAL within a GEOGRAPHY and LOADING SYS. If I take GEOGRAPHY out of the SELECT, then the query will return the MIN EOM BAL within a LOADING SYS. If I add another dimension to the query, maybe TIME.YEAR for instance, I get the proper results as well.&lt;/p&gt;&lt;p&gt;A couple of things to notice:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I had to check for the ALL member as the STRTOMEMBER function would not return a result so my Grand Total would error out without this check.&lt;/li&gt;&lt;li&gt;I still used the DESCENDANTS function to get to the lowest loan grain within the context of the query&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;CONCLUSION&lt;/h4&gt;&lt;p&gt;One can take advantage of the CURRENTMEMBER of a dimension's query context to obtain a different attribute's value within that DIMENSION. This value can then be used in a later calculation for basically creating a DYNAMIC SET according to the query context and essentially grouping by that value for your calculation. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-8406520326179460211?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/8406520326179460211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=8406520326179460211' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8406520326179460211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8406520326179460211'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/01/dynamic-set-for-mdx-calculations.html' title='Dynamic Set for MDX Calculations'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-6393627247838752006</id><published>2009-01-08T14:56:00.002-05:00</published><updated>2009-01-08T14:58:12.352-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Using SSIS to store and retrieve SharePoint List Data</title><content type='html'>Out of the box, SQL Server Integration Services provides a rich platform for building data integration and transformation solutions. The included SQL Server Business Intelligence Development Studio allows those who might not consider themselves 'coders' to create complex ETL packages that target the heart of most businesses - their data.&lt;br /&gt;&lt;br /&gt;However, one thing seems missing from the out of the box SSIS experience; That is the ability to use SharePoint Lists as data flow sources and destinations.&lt;br /&gt;&lt;br /&gt;Some might find this puzzling, given the great integration story found built into the Office suite of products - allowing Excel and Access to connect and retrieve data contained in SharePoint lists.&lt;br /&gt;&lt;br /&gt;Fortunately, there's a great community that surrounds SharePoint and provides solutions for common scenarios such as this one.&lt;br /&gt;&lt;br /&gt;The SharePoint List Source and Destination sample available on the Microsoft SQL Server Community Samples: Integration Services page on Codeplex provides a solution for SSIS Package creators to use SharePoint as a source as well as a destination in their SSIS data flows.&lt;br /&gt;&lt;br /&gt;In use, the sample provides SharePoint Data Flow Source and Destination components which allow the user to the SharePoint site URL and list name to use. Once configured, these Data Flow components can be used in conjunction with any other SSIS Data Flow Components.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_5EZulEhF3Zg/SWZU2kO02hI/AAAAAAAAAAc/9w9Erj8wuoY/s1600-h/SharePoint+SSIS.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 303px;" src="http://3.bp.blogspot.com/_5EZulEhF3Zg/SWZU2kO02hI/AAAAAAAAAAc/9w9Erj8wuoY/s320/SharePoint+SSIS.png" alt="" id="BLOGGER_PHOTO_ID_5289008108808755730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You can find these components, available for both SQL Server 2005 and SQL Server 2008, as well as sample instructions at the following locations:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeplex.com/SQLSrvIntegrationSrv/Release/ProjectReleases.aspx?ReleaseId=17652"&gt;SharePoint List Source and Destination sample&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd365137.aspx"&gt;MSDN Article&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-6393627247838752006?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/6393627247838752006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=6393627247838752006' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6393627247838752006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/6393627247838752006'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2009/01/using-ssis-to-store-and-retrieve.html' title='Using SSIS to store and retrieve SharePoint List Data'/><author><name>Sean McLellan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5EZulEhF3Zg/SWZU2kO02hI/AAAAAAAAAAc/9w9Erj8wuoY/s72-c/SharePoint+SSIS.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-4239785336545741040</id><published>2008-12-16T22:03:00.002-05:00</published><updated>2008-12-16T22:05:02.142-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Calculated Member'/><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS Calculated Member's Currency Format Displayed in Excel 2007</title><content type='html'>&lt;h4&gt;Problem&lt;/h4&gt;&lt;p&gt;After creating a calculated member in your SSAS cube, you connect to the cube via Excel 2007 and drag the calculation into your Pivot table. However, although the Format is set to Currency in the cube , the calculation appears as an unformatted number in the Pivot table.&lt;/p&gt;&lt;h4&gt;Solution&lt;/h4&gt;&lt;p&gt;When creating the calculation in the Form View, there is an Format String drop down box that allows for selecting “Currency” as the format. However, the LANGUAGE property of the calculation needs to be set for this to carry over into the Excel pivot table example described above. &lt;/p&gt;&lt;p&gt;To set the LANGUAGE property of the calculation, click on the Script View to show all calculations in the cube. In the Script View, the MDX can be edited for any and all calculations and additional properties can be added. These additional properties are not available via the Form View but the properties are valid MDX properties of a calculated member. One such property is the LANGUAGE property.&lt;/p&gt;&lt;p&gt;The LANGUAGE property accepts the LANGUAGE CODE ID as the value to be set. For example, the value for US Currency is 1033.&lt;/p&gt;&lt;p&gt;The following is an example of a simple calculated member with the LANGUAGE property being set:&lt;/p&gt;&lt;p&gt;CREATE MEMBER CURRENTCUBE.[MEASURES].[Avg Sales Amt]&lt;br /&gt; AS IIF(ISEMPTY([Measures].[SALES Count]), NULL, IIF([Measures].[SALES Count] = 0, 0,&lt;br /&gt;[Measures].[AMOUNT] / [Measures].[SALES Count])),&lt;br /&gt;FORMAT_STRING = "Currency", LANGUAGE=1033,&lt;br /&gt;NON_EMPTY_BEHAVIOR = { [AMOUNT] },&lt;br /&gt;VISIBLE = 1  ;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;For more information about the LANGUAGE property, navigate to the following KB article: &lt;a href="http://support.microsoft.com/kb/950598"&gt;http://support.microsoft.com/kb/950598&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-4239785336545741040?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/4239785336545741040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=4239785336545741040' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4239785336545741040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/4239785336545741040'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/12/ssas-calculated-member-currency-format.html' title='SSAS Calculated Member&amp;#39;s Currency Format Displayed in Excel 2007'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-5186893847780548710</id><published>2008-12-16T21:26:00.003-05:00</published><updated>2008-12-18T07:44:53.904-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup Task'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance Plan'/><title type='text'>Maintenance Plan SSIS Package fails on the exported server</title><content type='html'>&lt;h5&gt;&lt;em&gt;by Sarma Musty, Senior Consultant&lt;/em&gt;&lt;/h5&gt;&lt;h4&gt;Problem Statement&lt;/h4&gt;&lt;p&gt;Here we tried to solve the problem as mentioned the following link. &lt;/p&gt;&lt;p&gt;&lt;a href="http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/880fc71e-f214-4f87-85b3-592244764b49/"&gt;http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/880fc71e-f214-4f87-85b3-592244764b49/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The developer created a Maintenance Plan using SQL Server 2005 Maintenance Plan Wizard. The tasks included a backup database task. The Maintenance Plan package (SSIS) was exported to a different Server. While trying to edit the Backup Database task, the system threw the following error. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Bb_dqfXVtDU/SUhjUkRsi9I/AAAAAAAAAD0/NcLDP9H2ZXQ/clip_image002%5B3%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="70" alt="clip_image002" src="http://lh6.ggpht.com/_Bb_dqfXVtDU/SUhjU7H2IpI/AAAAAAAAAD4/zY0uPq8Z7TM/clip_image002_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Figure 1 - Error while editing the Back DB Task&lt;/p&gt;&lt;h4&gt;Background&lt;/h4&gt;&lt;p&gt;In SSIS, Backup Database Task is used to backing databases. The following diagram shows the screen for editing Backup Database Task. User can list the databases that need to be backed up and also provide information about locations, devices etc. The backup can be done on a Tape or Disk. &lt;/p&gt;&lt;p&gt;User can select “Backup databases across one or more files” and manually provide the list of backup files (&lt;b&gt;Manual&lt;/b&gt; Option). Or he/she can select “Create a backup file for every database” and give a path for the backups (&lt;b&gt;Auto&lt;/b&gt; Option). In this option system will generate backup files automatically. This property is saved in “DestinationCreationType” attribute of Backup Database Task properties. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Bb_dqfXVtDU/SUhjVOBXn6I/AAAAAAAAAD8/RdOc5qKrMR4/clip_image004%5B3%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="244" alt="clip_image004" src="http://lh5.ggpht.com/_Bb_dqfXVtDU/SUhjVQXXrCI/AAAAAAAAAEA/msIwWR_MqjY/clip_image004_thumb.jpg" width="210" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Figure 2 - Edit Screen on Back DB Task&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_Bb_dqfXVtDU/SUhjVQkEh4I/AAAAAAAAAEE/OKJgX7F-EF4/clip_image006%5B3%5D.jpg"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="219" alt="clip_image006" src="http://lh4.ggpht.com/_Bb_dqfXVtDU/SUhjVpcRPLI/AAAAAAAAAEQ/LkgHSDHVmfA/clip_image006_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Figure 3 - Backup DB Task Properties&lt;/p&gt;&lt;p&gt;In the problem, the setting that the developer opted was manual and a backup file location was also provided. The system was not able to recognize this list. Possible reasons could be that system was not able to recognize the location or device that’s defined in the task. Nevertheless, the error message does not give any details about the actual reason. &lt;/p&gt;&lt;h4&gt;Solution&lt;/h4&gt;&lt;p&gt;As a work around, we changed the DestinationCreationType property from Manual to Auto. After this change the edit screen of the Back Datbase Task is working as expected. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-5186893847780548710?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/5186893847780548710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=5186893847780548710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5186893847780548710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/5186893847780548710'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/12/maintenance-plan-ssis-package-fails-on.html' title='Maintenance Plan SSIS Package fails on the exported server'/><author><name>Chuck Rivel</name><uri>http://www.blogger.com/profile/05290272415899934531</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_Bb_dqfXVtDU/SUhjU7H2IpI/AAAAAAAAAD4/zY0uPq8Z7TM/s72-c/clip_image002_thumb.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-3987848876750766799</id><published>2008-12-12T08:20:00.005-05:00</published><updated>2008-12-12T08:53:52.323-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='PerformancePoint Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance Management'/><category scheme='http://www.blogger.com/atom/ns#' term='PPS Planning'/><title type='text'>New Technet Post on Installing PerformancePoint Server SP2 with SQL Server 2008</title><content type='html'>I was updating a virtual server instance to use SQL Server 2008 with PerformancePoint, specifically with the new SP2.  Come to find out unstalling the PerformancePoint 2007  SP2 components with SQL Server 2008 and getting a working configuration is not the most straightforward process.  It involves the download and installation of a handful of hot fixes and utilities to get past - among other things -communication issues betwen the Planning components and SQL Server 2008.  There's a recent TechNet article that provides the details that helped me get this working:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/dd335965.aspx"&gt;http://technet.microsoft.com/en-us/library/dd335965.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-3987848876750766799?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/3987848876750766799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=3987848876750766799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3987848876750766799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/3987848876750766799'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/12/new-technet-post-on-installing.html' title='New Technet Post on Installing PerformancePoint Server SP2 with SQL Server 2008'/><author><name>Derek Strausbaugh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-332956985203255831</id><published>2008-12-03T13:58:00.016-05:00</published><updated>2008-12-04T14:06:12.923-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Change Data Capture'/><category scheme='http://www.blogger.com/atom/ns#' term='CHANGETABLE'/><title type='text'>Resolving update conflicts with Change Data Capture</title><content type='html'>Another use of the new SQL Server 2008 feature Change Data Capture (CDC) is to resolve conflicts between multiple updates.&lt;br /&gt;&lt;br /&gt;Consider a large online store where multiple business users update product information. Suppose product specialists use a big form to enter the data. Suppose also that one user can only update unit name or size. Another user can change product category. Let's see how we can use CDC to accurately track the changes.&lt;br /&gt;&lt;br /&gt;Assume the following table holds the products:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_Bh5FeAzGavE/STgiqMoZ9YI/AAAAAAAAAAc/wIQKV0zReCI/s1600-h/CDC+update+conflict.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5276005071805085058" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 198px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Bh5FeAzGavE/STgiqMoZ9YI/AAAAAAAAAAc/wIQKV0zReCI/s320/CDC+update+conflict.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In the Management Studio I opened table properties, selected Change Tracking, and enabled both "Change Tracking" and "Track Columns Updated". Note that a primary key is required for change tracking. This&lt;br /&gt;command can accomplish the same from a script:&lt;br /&gt;&lt;span style="color:blue;"&gt;ALTER TABLE&lt;/span&gt; Products &lt;span style="color:blue;"&gt;ENABLE CHANGE_TRACKING&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;WITH&lt;span style="color:black;"&gt; (&lt;/span&gt;&lt;span style="color:blue;"&gt;TRACK_COLUMNS_UPDATED = ON&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When a user opens a Web form and intends to change the UnitName, application records the current version of the row that contains product data. We can use one of the new SQL 2008 functions to determine the current version of the database row:&lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE &lt;span style="color:black;"&gt;@prevVersion&lt;/span&gt; integer&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; @prevVersion = SYS_CHANGE_VERSION&lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CHANGETABLE&lt;/span&gt;(&lt;span style="color:blue;"&gt;VERSION&lt;/span&gt; Products, (ProductID), (1)) CT&lt;br /&gt;The query selects the current version of a product with ID of 1 and saves it in variable @prevVersion.&lt;br /&gt;&lt;br /&gt;The user makes desired changes and wants to save the data. To update the row in the database the application runs the following query:&lt;br /&gt;&lt;span style="color:blue;"&gt;UPDATE&lt;/span&gt; Products&lt;br /&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt; Name=&lt;span style="color:red;"&gt;'CDC Power'&lt;/span&gt;, UnitName=&lt;span style="color:red;"&gt;'book and CD'&lt;/span&gt;, Category=&lt;span style="color:red;"&gt;'Books'&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CHANGETABLE&lt;/span&gt;(&lt;span style="color:blue;"&gt;VERSION&lt;/span&gt; Products, (ProductID), (1)) CT&lt;br /&gt;&lt;span style="color:gray;"&gt;JOIN&lt;/span&gt; Products P &lt;span style="color:blue;"&gt;ON&lt;/span&gt; P.ProductID = CT.ProductID&lt;br /&gt;&lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;CT.SYS_CHANGE_VERSION = @prevVersion&lt;br /&gt;&lt;br /&gt;The WHERE clause condition ensures that the data in the database has not changed since the application last retrieved it.&lt;br /&gt;&lt;br /&gt;Suppose that at the same time the first user is making the change, another user is changing category for the same product using the same query. The update executed by the first user increments the current version of the row, so the above query updates no rows for the second user. If the application did not check the version, the second update statement could override UnitName with obsolete data.&lt;br /&gt;&lt;br /&gt;Now consider changing the application, so that the query for the second user updates the Category column only. It can execute the following query:&lt;br /&gt;&lt;span style="color:blue;"&gt;UPDATE&lt;/span&gt; Products&lt;br /&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt; Category=&lt;span style="color:red;"&gt;'Programming Guides'&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CHANGETABLE&lt;/span&gt;(&lt;span style="color:blue;"&gt;CHANGES&lt;/span&gt; Products, 1) CT&lt;br /&gt;&lt;span style="color:gray;"&gt;JOIN&lt;/span&gt; Products P&lt;span style="color:blue;"&gt; ON&lt;/span&gt; P.ProductID = CT.ProductID&lt;br /&gt;&lt;span style="color:blue;"&gt;WHERE&lt;/span&gt; P.ProductID = 1&lt;br /&gt;&lt;span style="color:gray;"&gt;AND&lt;/span&gt; CT.SYS_CHANGE_VERSION = @prevVersion&lt;br /&gt;&lt;span style="color:gray;"&gt;AND&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CHANGE_TRACKING_IS_COLUMN_IN_MASK&lt;/span&gt;(&lt;span style="color:fuchsia;"&gt;COLUMNPROPERTY&lt;/span&gt;(&lt;span style="color:fuchsia;"&gt;OBJECT_ID&lt;/span&gt;(&lt;span style="color:red;"&gt;'Products'&lt;/span&gt;), &lt;span style="color:red;"&gt;'Category'&lt;/span&gt;, &lt;span style="color:red;"&gt;'ColumnId'&lt;/span&gt;), CT.SYS_CHANGE_COLUMNS) = 0&lt;br /&gt;&lt;br /&gt;The CHANGE_TRACKING_IS_COLUMN_IN_MASK function tells us whether the Category column has been updated since the last check. Since that is the only column the query updates, we can ignore changes to other columns. Now the query would succeed even if both users initially looked at the same version of the row. By checking which columns have actually changed, the conflicting updates will more likely succeed. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-332956985203255831?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/332956985203255831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=332956985203255831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/332956985203255831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/332956985203255831'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/12/resolving-update-conflicts-with-change.html' title='Resolving update conflicts with Change Data Capture'/><author><name>Mark Meyerovich</name><uri>http://www.blogger.com/profile/12476784828041031092</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Bh5FeAzGavE/STgiqMoZ9YI/AAAAAAAAAAc/wIQKV0zReCI/s72-c/CDC+update+conflict.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-8272528890401983247</id><published>2008-11-12T16:39:00.014-05:00</published><updated>2008-11-13T10:08:41.498-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='compliance'/><category scheme='http://www.blogger.com/atom/ns#' term='Change Data Capture'/><category scheme='http://www.blogger.com/atom/ns#' term='auditing'/><title type='text'>Hand off your change tracking or auditing requirements to SQL Server 2008</title><content type='html'>If you are writing additional code to satisfy regulatory compliance or auditing requirements, consider new features of SQL Server 2008. Perhaps your custom applications must support compliance with HIPAA, OFCCP, or other regulations. You may be saving additional copies of your data in the database to satisfy those regulations.&lt;br /&gt;&lt;br /&gt;Enter SQL Server 2008, assuming it's easy for you to upgrade to that latest release (and it probably is, if you are already on SQL Server 2005). Its new &lt;a href="http://msdn.microsoft.com/en-us/library/cc645937.aspx"&gt;Change Data Capture&lt;/a&gt; (CDC) feature copies the data for the tables you specify. While designed to support ETL processes for efficient loading of data warehouses or marts, it can serve well in scenarios where much of the data changes must be captured and stored in separate tables. Here's a data flow diagram in data warehousing scenario:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Bh5FeAzGavE/SRw7z9pl46I/AAAAAAAAAAU/NMwDzocalZ0/s1600-h/CDC.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5268151428025017250" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 191px; CURSOR: hand; HEIGHT: 320px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Bh5FeAzGavE/SRw7z9pl46I/AAAAAAAAAAU/NMwDzocalZ0/s320/CDC.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Also, a Channel 9 webcast goes into &lt;a href="http://channel9.msdn.com/posts/ashishjaiman/CDC-Change-Data-Capture-SQL-Server-2008/"&gt;technical details about setting up and using CDC&lt;/a&gt;, but this is what's in it for you:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;If you use CDC you can forget about writing and maintaining additional code just for compliance purpose.&lt;/li&gt;&lt;li&gt;You stop worrying whether your additional database updates slow down the performance of core functions, as CDC tracks data asynchronously. (If you have doubts about performance check out this case study about &lt;a href="http://www.microsoft.com/web/content.aspx?id=case-study-orf-austrian-broadcasting-corporation"&gt;Austrian sports broadcasters&lt;/a&gt;.)&lt;/li&gt;&lt;li&gt;You don't have to prove to anyone that your compliance code does what it's supposed to, as you can point to the well-defined and published features of your database that you simply turn on.&lt;/li&gt;&lt;li&gt;You can reliably access captured data in a relational format. Already there are tools that help you manage the data from CDC: &lt;a href="http://www.codeplex.com/CDCHelper"&gt;http://www.codeplex.com/CDCHelper&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;On the other hand, you may not need to save detailed history of all updates to your data. Perhaps you only need to know that data in certain columns changed or track the user making the changes. Then consider Change Tracking or Auditing features of SQL Server 2008.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-8272528890401983247?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/8272528890401983247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=8272528890401983247' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8272528890401983247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/8272528890401983247'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/11/hand-off-your-change-tracking-or.html' title='Hand off your change tracking or auditing requirements to SQL Server 2008'/><author><name>Mark Meyerovich</name><uri>http://www.blogger.com/profile/12476784828041031092</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Bh5FeAzGavE/SRw7z9pl46I/AAAAAAAAAAU/NMwDzocalZ0/s72-c/CDC.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-7876733101476512433</id><published>2008-11-11T08:22:00.001-05:00</published><updated>2008-11-11T08:22:13.978-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>SSIS Package Layout</title><content type='html'>&lt;p&gt;If you produce SSIS packages for a customer, even if that &amp;quot;customer&amp;quot; is the company you work for, then this tip is for you.&lt;/p&gt;  &lt;p&gt;When you create a new SSIS package and start adding items to the design surface you can quickly create a mess if you're not careful.&amp;#160; Even if you are careful it is still quite difficult to precisely place the items so that the connecting lines line up.&lt;/p&gt;  &lt;p&gt;For example, I quickly created a package which performs some common tasks:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TOeRMKboMMQ/SRmG__vW2eI/AAAAAAAAAOs/o_2qy5MVQic/s1600-h/SSISPackageBeforeCleanup3.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="217" alt="SSIS Package - Before Cleanup" src="http://lh3.ggpht.com/_TOeRMKboMMQ/SRmHAF8NyeI/AAAAAAAAAOw/-N4pYtKNYcI/SSISPackageBeforeCleanup_thumb1.png?imgmax=800" width="366" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see, the various items are positioned on the design surface in a haphazard way.&amp;#160; You can spend time dragging the items around until you get a layout that looks better, or you can use the power of the &amp;quot;Layout&amp;quot; toolbar to assist you.&lt;/p&gt;  &lt;p&gt;By default, the &amp;quot;Layout&amp;quot; toolbar is not displayed in BIDS.&amp;#160; To display it, right-click on an empty part of the toolbar and click on Layout (or you can click on &amp;quot;Tools | Customize...&amp;quot; and click the check box next to Layout):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TOeRMKboMMQ/SRmHAaDAAoI/AAAAAAAAAO0/y_V12X1N0jg/s1600-h/TurnonLayoutToolbar2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="72" alt="Turn on Layout Toolbar" src="http://lh5.ggpht.com/_TOeRMKboMMQ/SRmHAUHayvI/AAAAAAAAAO4/n9Gl3su1v_E/TurnonLayoutToolbar_thumb.png?imgmax=800" width="163" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160; You should see the Layout toolbar displayed:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TOeRMKboMMQ/SRmHAn_owiI/AAAAAAAAAO8/QVfrZ4NlZi8/s1600-h/TheLayoutToolbar3.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="37" alt="The Layout Toolbar" src="http://lh3.ggpht.com/_TOeRMKboMMQ/SRmHA7j-VHI/AAAAAAAAAPA/Hhyl7XXuMlg/TheLayoutToolbar_thumb1.png?imgmax=800" width="455" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To fix the layout of my package, I first selected all of the items.&amp;#160; You do this either by clicking on the design surface and dragging the selection box around all of the items or by shift-clicking on each of the items until they are all selected.&amp;#160; Look closely at each of the items--one item will have white &amp;quot;grab handles&amp;quot; and the rest will have black grab handles.&amp;#160; The one with the white handles acts as the anchor for the items in the Layout tool bar that act on multiple items.&amp;#160; For example, if you click on the &amp;quot;Align Lefts&amp;quot; button, the left sides of each item will be set to the left position of the anchored item.&lt;/p&gt;  &lt;p&gt;I used a combination of &amp;quot;Align Lefts&amp;quot;, &amp;quot;Increase Vertical Spacing&amp;quot;, and &amp;quot;Make Vertical Spacing Equal&amp;quot; to align my items in a vertical column:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TOeRMKboMMQ/SRmHBNbN5tI/AAAAAAAAAPE/DIlln9D1DaE/s1600-h/SSISPackageAfterCleanup2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="SSIS Package - After Cleanup" src="http://lh5.ggpht.com/_TOeRMKboMMQ/SRmHBfcm96I/AAAAAAAAAPI/Pu89FSwPNA8/SSISPackageAfterCleanup_thumb.png?imgmax=800" width="131" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It took my just a handful of clicks and about 20 seconds to perfectly align the items for a professional look.&lt;/p&gt;  &lt;p&gt;If you have auto-sized any of your shapes, you are still in luck.&amp;#160; Instead of &amp;quot;Align Lefts&amp;quot; you can choose &amp;quot;Align Centers&amp;quot; to keep the arrows straight.&lt;/p&gt;  &lt;p&gt;I'm sure that you have your favorite way to lay out your items in your packages, such as a cascading look where the arrows go down, over, and then down again.&amp;#160; While that isn't directly supported by the layout toolbar you can still make use of the toolbar to &amp;quot;Make Vertical Space Equal&amp;quot; after moving your items where you want them.&lt;/p&gt;  &lt;p&gt;Leave a comment if you have additional tips for using the Layout toolbar with SSIS packages.&lt;/p&gt;  &lt;p&gt;Farewell.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-7876733101476512433?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/7876733101476512433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=7876733101476512433' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7876733101476512433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7876733101476512433'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/11/ssis-package-layout.html' title='SSIS Package Layout'/><author><name>Steve Jackson</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_TOeRMKboMMQ/Sluedtwf9GI/AAAAAAAAARo/IyLJPV-sv5E/S220/HeadShot.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_TOeRMKboMMQ/SRmHAF8NyeI/AAAAAAAAAOw/-N4pYtKNYcI/s72-c/SSISPackageBeforeCleanup_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-9217517767680669144</id><published>2008-11-10T11:31:00.003-05:00</published><updated>2008-11-10T11:44:35.828-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Capturing LINQ Output</title><content type='html'>&lt;p&gt;If you use LINQ to SQL in your projects, you may find yourself wondering just what actual SQL gets generated and executed against your database.&amp;#160; If you're a DBA, you'd probably break out the SQL Profiler.&amp;#160; But if you come from a development background, or are just not adept at performing SQL traces, then there is a code-only solution for you.&lt;/p&gt;  &lt;p&gt;It turns out that the DataContext class exposes a property called Log, which allows you to specify a System.IO.TextWriter which will receive the SQL commands which are generated.&lt;/p&gt;  &lt;p&gt;In a &lt;a href="http://bisqlserver.blogspot.com/2008/10/using-linq-to-call-stored-procedure.html" target="_blank"&gt;previous post&lt;/a&gt; I showed how to call a stored procedure from LINQ.&amp;#160; In this post I'll show the SQL calls produced.&lt;/p&gt;  &lt;p&gt;The first call in that project was to load all the managers in the database.&amp;#160; I defined a manager as a person who had 1 or more &amp;quot;Employees&amp;quot; associated with him or her.&amp;#160; As a reminder, the LINQ query looked like this:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; var managers = (from m &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; dc.Employees&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; m.Employees.Count() &amp;gt; 0&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;                 select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EmployeeData&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;                 {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;                     Name = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;{0}, {1}&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;                         m.Contact.LastName,&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;                         m.Contact.FirstName),&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                     ID = m.EmployeeID&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;                 }).Distinct();&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;I changed the code to write the output to a temporary file by adding one line of code, like so (make sure you have the AutoFlush property set to true, or flush the Log property manually, otherwise you may not see any messages in the file):&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; dc.Log = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.IO.StreamWriter(&lt;span style="color: #006080"&gt;@&amp;quot;C:\Temp\LinqOutput.txt&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;, UTF8Encoding.UTF8) { AutoFlush = true };&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Now when the code is run the log file in my C:\Temp folder has the following in it:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;DISTINCT&lt;/span&gt; [t2].[EmployeeID] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [ID], [t2].[&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;], [t2].[LastName] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [arg0], [t2].[FirstName] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [arg1]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; (&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; [t0].[EmployeeID], @p0 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;], [t1].[LastName], [t1].[FirstName]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [HumanResources].[Employee] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t0]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; [Person].[Contact] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t1] &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [t1].[ContactID] = [t0].[ContactID]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     ) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t2]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; ((&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*)&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [HumanResources].[Employee] &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [t3]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; [t3].[ManagerID] = [t2].[EmployeeID]&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;     )) &amp;gt; @p1&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- @p0: Input NVarChar (Size = 8; Prec = 0; Scale = 0) [{0}, {1}]&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- @p1: Input Int (Size = 0; Prec = 0; Scale = 0) [0]&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Here you can see exactly what gets sent to SQL Server.&amp;#160; Let's take a look at how a stored procedure is called (which was the point of my last blog post).&amp;#160; After modifying the code to set the Log property, here are the results:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; @RETURN_VALUE = [dbo].[uspGetManagerEmployees] @ManagerID = @p0&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- @p0: Input Int (Size = 0; Prec = 0; Scale = 0) [3]&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- @RETURN_VALUE: Output Int (Size = 0; Prec = 0; Scale = 0) [Null]&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;As you can see, LINQ &amp;quot;knows&amp;quot; how to call stored procedures with parameters and can return a return value as well.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you don't want to write to a file, then anything that derives from a System.IO.TextWriter will do, including your own classes.&amp;#160; One class you might find value in implementing is one that overrides the Write method and in turn calls System.Diagnostics.Debug.Write.&amp;#160; If an instance of this class is assigned to the Log property of your DataContext class then you can see the SQL directly in the output window of Visual Studio (or &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx" target="_blank"&gt;other debug viewer programs&lt;/a&gt;).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Leave a comment if you have used this functionality in other creative ways!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-9217517767680669144?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/9217517767680669144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=9217517767680669144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9217517767680669144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/9217517767680669144'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/11/capturing-linq-output.html' title='Capturing LINQ Output'/><author><name>Steve Jackson</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_TOeRMKboMMQ/Sluedtwf9GI/AAAAAAAAARo/IyLJPV-sv5E/S220/HeadShot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-7277224097379684218</id><published>2008-10-28T20:16:00.001-04:00</published><updated>2008-10-28T20:16:17.290-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>VSTS Database Edition for SQL 2008 is Available</title><content type='html'>&lt;p&gt;Just announced at the PDC:&amp;#160; the Visual Studio Team System Database Edition GDR Release Candidate is available.&amp;#160; See &lt;a href="http://blogs.msdn.com/gertd/archive/2008/10/27/the-gdr-rc-is-here.aspx" target="_blank"&gt;this link&lt;/a&gt; for information, or skip right to the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&amp;amp;displaylang=en" target="_blank"&gt;download page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There are no new features since the September CTP release, just bug fixes and performance enhancements.&lt;/p&gt;  &lt;p&gt;You must have Visual Studio 2008 SP1 installed, as well as SQL Server Compact Edition 3.5 SP1.&amp;#160; If you have a previous version of the GDR installed, you must uninstall it before installing this version.&lt;/p&gt;  &lt;p&gt;According to an &lt;a href="http://blogs.msdn.com/gertd/archive/2008/09/30/visual-studio-team-system-2008-database-edition-gdr-september-ctp.aspx" target="_blank"&gt;earlier post&lt;/a&gt;, this version is a &amp;quot;go-live&amp;quot; release, meaning you can use it to develop code that you intend to go live with, though you'll need to wait for the RTM version before doing so.&amp;#160; However, there is no mention on the latest blog post as to whether this is actually a &amp;quot;go-live&amp;quot; release, so do your own due diligence before assuming anything.&amp;#160; I've pinged the blogger, GertD, about whether this is the case, and I'll update this post when I have an answer.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-7277224097379684218?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/7277224097379684218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=7277224097379684218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7277224097379684218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/7277224097379684218'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/10/vsts-database-edition-for-sql-2008-is.html' title='VSTS Database Edition for SQL 2008 is Available'/><author><name>Steve Jackson</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_TOeRMKboMMQ/Sluedtwf9GI/AAAAAAAAARo/IyLJPV-sv5E/S220/HeadShot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-2995919885764689653</id><published>2008-10-23T13:48:00.004-04:00</published><updated>2008-10-23T16:34:22.930-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best Practice'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Passing .NET data types in Parameters to Stored Procedure</title><content type='html'>&lt;strong&gt;&lt;em&gt;Structured Query Language&lt;/em&gt;&lt;/strong&gt; is very forgiving in its automatic type conversion, sometimes too much so. Recently I encountered a stored procedure, written by a co-worker, that passed a GUID cast as a string to a varchar(255) stored procedure parameter, which was then directly inserted into a table that expected a uniqueidentifier (SQL for GUID). While the team quickly agreed this sort of type coercion was something best avoided, they also asked me for a mapping guide for .NET data types to SQL Server data types. This blog post is the answer to that request.&lt;br /&gt;Generally speaking, most .NET data types have a counterpart in the SQL world and vice versa, although there are some differences and caveats. For example, there is no &lt;strong&gt;&lt;em&gt;Unsigned&lt;/em&gt;&lt;/strong&gt; integer in SQL, and SQL DateTimes have different range limitations from their .NET counterparts. More on that in a little while.&lt;br /&gt;Here is the list of .NET data types and their SQL counterparts. This list is adapted from SQL Server documentation and is presented in a .NET-centric way. It is not necessarily inclusive of all defined SQL data types; rather the intention is to provide a data type for each .NET data type.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Boolean&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;bit&lt;/em&gt;&lt;/strong&gt;. Note that SQL Server stores up to 8 bits within a given table row into each byte of data on the disk. So storing 8 boolean flags has the same storage cost as a single byte field. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Byte[]&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;binary(n)&lt;/em&gt;&lt;/strong&gt; if the size is always the same or a &lt;strong&gt;&lt;em&gt;varbinary(n)&lt;/em&gt;&lt;/strong&gt; if the size will vary and not exceed 8000 bytes. For Byte[] buffers &gt; 8000 bytes, pass to a &lt;strong&gt;&lt;em&gt;varbinary(max)&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;byte&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;TinyInt&lt;/em&gt;&lt;/strong&gt;. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Byte[1]&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;binary(1)&lt;/em&gt;&lt;/strong&gt; or &lt;em&gt;&lt;strong&gt;varbinary(1)&lt;/strong&gt;&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;char&lt;/strong&gt;, &lt;strong&gt;char[1]&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;nchar(1)&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;nvarchar(1)&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;char[]&lt;/strong&gt;, &lt;strong&gt;string&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;nchar(n)&lt;/em&gt;&lt;/strong&gt; if the size is always the same or a &lt;strong&gt;&lt;em&gt;nvarchar(n)&lt;/em&gt;&lt;/strong&gt; if the size will vary and not exceed 8000 bytes. For char[] strings &gt; 8000 bytes long, pass to a &lt;strong&gt;&lt;em&gt;nvarchar(max)&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;datetime&lt;/strong&gt;: Pass to a &lt;strong&gt;&lt;em&gt;DateTime&lt;/em&gt;&lt;/strong&gt; or a &lt;strong&gt;&lt;em&gt;SmallDateTime&lt;/em&gt;&lt;/strong&gt;, depending on the precision needed or the time range to be stored. The &lt;strong&gt;&lt;em&gt;DateTime&lt;/em&gt;&lt;/strong&gt; stores Date and time data from January 1, 1753, to December 31, 9999, with an accuracy of one three-hundredth second, or 3.33 milliseconds. Values are rounded to increments of .000, .003, or .007 milliseconds. The &lt;strong&gt;&lt;em&gt;SmallDateTime&lt;/em&gt;&lt;/strong&gt; stores Date and time data from January 1, 1900, to December 31, 2079, with an accuracy of one minute. &lt;em&gt;Note that attempting to store the .NET value DateTime.MinValue in an SQL Server database will cause an out-or-range error for both SQL DateTime and SmallDateTime data types.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Decimal&lt;/strong&gt;: can pass to several data types, depending on the need. Using this type presumes a high degree of &lt;em&gt;a priori&lt;/em&gt; knowledge about the values to be stored. If this is not the case, consider using a more general-purpose &lt;em&gt;single-to-real&lt;/em&gt; or &lt;em&gt;double-to-float&lt;/em&gt; data type instead.&lt;br /&gt;The &lt;strong&gt;&lt;em&gt;decimal(p,s)&lt;/em&gt;&lt;/strong&gt; data type allows precision and scale of a decimal number to be specified. The storage size varies depending on the precision and scale values chosen.&lt;br /&gt;The &lt;strong&gt;&lt;em&gt;money &lt;/em&gt;&lt;/strong&gt;data type holds values from (–2^63/10000) (–922,337,203,685,477.5808) through (2^63/10000)–1 (922,337,203,685,477.5807), with accuracy to 1/10000 of a monetary unit. Storage size is 8 bytes.&lt;br /&gt;The &lt;strong&gt;&lt;em&gt;numeric(p,s)&lt;/em&gt;&lt;/strong&gt; data type holds fixed-precision and scale-numeric data from –10^38+1 through 10^38–1. The p variable specifies precision and can vary between 1 and 38. The s variable specifies scale and can vary between 0 and p. Storage size is 19 bytes.&lt;br /&gt;The &lt;strong&gt;&lt;em&gt;smallmoney&lt;/em&gt;&lt;/strong&gt; data type holds values from (–2^31/10000) (–214,748.3648) through (2^31/10000)–1 (214,748.3647), with accuracy to 1/10000 of a monetary unit. Storage size is 4 bytes.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Double&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;float&lt;/em&gt;&lt;/strong&gt; (double-precision floating-point number).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;guid&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;uniqueidentifier&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Int16&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;SmallInt&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Int32&lt;/strong&gt;: pass to a &lt;em&gt;&lt;strong&gt;Int&lt;/strong&gt;&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Int64&lt;/strong&gt;: pass to a &lt;em&gt;&lt;strong&gt;Bigint&lt;/strong&gt;&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single&lt;/strong&gt;: pass to a &lt;strong&gt;&lt;em&gt;real&lt;/em&gt;&lt;/strong&gt; (single-precision floating-point number).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Object&lt;/strong&gt;: pass to an &lt;strong&gt;&lt;em&gt;sql_variant&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Unsigned&lt;/strong&gt;: there is no SQL Server support for Unsigned integers, except for Unsigned char, which can be stored as a tinyint. Larger Unsigned values may be stored in binary(n) fields.&lt;br /&gt;For &lt;strong&gt;Unsigned Char&lt;/strong&gt; or &lt;strong&gt;UInt8&lt;/strong&gt;, use &lt;strong&gt;&lt;em&gt;tinyint&lt;/em&gt;&lt;/strong&gt; or&lt;strong&gt;&lt;em&gt; binary(1)&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;For &lt;strong&gt;Unsigned Short&lt;/strong&gt; or &lt;strong&gt;UInt16&lt;/strong&gt;, use &lt;strong&gt;&lt;em&gt;binary(2)&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;For &lt;strong&gt;Unsigned Int&lt;/strong&gt; or &lt;strong&gt;UInt32&lt;/strong&gt;, use &lt;strong&gt;&lt;em&gt;binary(4)&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;For &lt;strong&gt;Unsigned Long&lt;/strong&gt; or &lt;strong&gt;UInt64&lt;/strong&gt;, use &lt;strong&gt;&lt;em&gt;binary(8)&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;For more information, start in SQL Server help at:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/89b43ee9-b9ad-4281-a4bf-c7c8d116daa2.htm&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35862303-2995919885764689653?l=bisqlserver.rdacorp.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bisqlserver.rdacorp.com/feeds/2995919885764689653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35862303&amp;postID=2995919885764689653' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2995919885764689653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35862303/posts/default/2995919885764689653'/><link rel='alternate' type='text/html' href='http://bisqlserver.rdacorp.com/2008/10/passing-net-data-types-as-paramters-to.html' title='Passing .NET data types in Parameters to Stored Procedure'/><author><name>John Keimig</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35862303.post-1095135567608586027</id><published>2008-10-21T11:16:00.005-04:00</published><updated>2008-10-23T12:19:58.014-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Using LINQ to call a Stored Procedure</title><content type='html'>&lt;p&gt;You have almost certainly heard of LINQ by now: Language INtegrated Query. It's the new technology supported by Visual Studio 2008 and the C# and VB.NET languages, introduced in .NET 3.5 and C# 3.0 (it is supported in VB.NET, as well, but my examples all use C#). Perhaps you have even used it to retrieve and update data in your database tables.&lt;/p&gt;&lt;p&gt;But did you know that LINQ has support for calling Stored Procedures as well? This article describes the steps to take for calling a Stored Procedure from LINQ. The first part of the article sets up the project. If you have a project already and want to skip to the LINQ portion, &lt;a href="#AddingTheStoredProcedureToTheDesignSurface"&gt;click here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;In This Article&lt;/strong&gt;&lt;br /&gt;&lt;a href="#SettingUpTheProject"&gt;Setting Up The Project&lt;/a&gt;&lt;br /&gt;&lt;a href="#AddingTheStoredProcedureToTheDesignSurface"&gt;Adding the Stored Procedure to the Design Surface&lt;/a&gt;&lt;br /&gt;&lt;a href="#PopulatingTheComboBox"&gt;Populating the Combo Box&lt;/a&gt;&lt;br /&gt;&lt;a href="#CallingTheStoredProcedure"&gt;Calling the Stored Procedure&lt;/a&gt;&lt;br /&gt;&lt;a href="#WhatsTheBigDeal"&gt;What's the Big Deal?&lt;/a&gt;&lt;br /&gt;&lt;a href="#HowLINQHandlesStoredProcedureParameters"&gt;How LINQ Handles Stored Procedure Parameters&lt;/a&gt;&lt;br /&gt;&lt;a href="#HowElseCanIUseStoredProcedures"&gt;How Else Can I Use Stored Procedures?&lt;/a&gt;&lt;br /&gt;&lt;a href="#Conclusion"&gt;Conclusion&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a name="SettingUpTheProject"&gt;Setting Up The Project&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;For this example I'll create a new WinForm project and add a Combo Box to select different managers and a Data Grid View to hold the results:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/stevenljackson1/SP3yOKrCGDI/AAAAAAAAANM/fLznzzQkUJI/s1600-h/2008-10-17-01%20Initial%20Form%20Layout%5B2%5D.png"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="182" alt="2008-10-17-01 Initial Form Layout" src="http://lh6.ggpht.com/stevenljackson1/SP3yOIKQUwI/AAAAAAAAANQ/2CSYKCocUec/2008-10-17-01%20Initial%20Form%20Layout_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Before you can select data, you need a connection to your database. To do this, click on the Server Explorer, right-click "Data Connections" and select "Add Connection...". I'm using the AdventureWorks database which can be installed with SQL Server. The database is on the same machine that I'm developing on, so "localhost" works as the host name.&lt;/p&gt;&lt;p&gt;Once the data connection is created a DBML file must be added to the project for LINQ support. To do this, right-click on the project name and choose "Add", then "New Item...". In the "Add New Item" dialog box, select "LINQ to SQL Classes". Provide a file name and then click "Add" (I'm using the default name of "DataClasses1"). The LINQ to SQL design surface is displayed.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a name="AddingTheStoredProcedureToTheDesignSurface"&gt;Adding the Stored Procedure to the Design Surface&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;From the Server Explorer, expand the data connection, then expand the "Stored Procedures" node to get a list of stored procedures. Drag "uspGetManagerEmployees" and drop it onto the design surface. If you don't see anything happen, right-click the design surface and select "Show Methods Pane". You should now see that the stored procedure has been added to the design surface (though it doesn't appear as a table; rather it looks like a function call). The following image shows the stored procedure in the Methods Pane, as well as the Contact and Employee tables in the main design pane, which I added in order to populate the combo box in the UI:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/stevenljackson1/SP3yOWU8SoI/AAAAAAAAANU/PwO08E2ebXg/s1600-h/2008-10-20-02%20DBML%20design%20surface%5B8%5D.png"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="244" alt="2008-10-20-02 DBML design surface" src="http://lh3.ggpht.com/stevenljackson1/SP3yOeeYC-I/AAAAAAAAANY/WIEIOBAAPiI/2008-10-20-02%20DBML%20design%20surface_thumb%5B6%5D.png?imgmax=800" width="238" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a name="PopulatingTheComboBox"&gt;Populating the Combo Box&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;Before we can call the stored procedure, which is the focus of this article, we need to get some data onto the form to work with. For this example, we'll load manager names into the combo box. When a manager is selected in the combo box we'll then call the stored procedure to select the Employees who report to the manager.&lt;/p&gt;&lt;p&gt;The following code selects the manager names and loads them into the combo box:&lt;/p&gt;&lt;div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; BORDER-BOTTOM-WIDTH: 1px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; BORDER-BOTTOM: gray 1px solid;" &gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; font-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none;font-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#
