<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">SQL Blog - Pieter van Maasdam, Macaw</title><subtitle type="html">SSIS, SSAS, SSRS &amp;amp; other SQL-things I come across...</subtitle><id>http://sqlblogcasts.com/blogs/repieter/atom.aspx</id><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/default.aspx" /><link rel="self" type="application/atom+xml" href="http://sqlblogcasts.com/blogs/repieter/atom.aspx" /><generator uri="http://communityserver.org" version="3.1.20917.1142">Community Server</generator><updated>2007-10-23T12:53:00Z</updated><entry><title>SSAS 2008 - Connection from Excel</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2009/03/03/ssas-2008-connection-from-excel.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2009/03/03/ssas-2008-connection-from-excel.aspx</id><published>2009-03-03T12:31:00Z</published><updated>2009-03-03T12:31:00Z</updated><content type="html">&lt;p&gt;I had some trouble connecting to an SSAS 2008 cube with Excel 2007. The problem was that Windows Firewall blocked the connection. A colleague of mine pointed out that you need to open 2 tcp ports on the server: 2382 and 2383. That did the trick.&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11401" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author><category term="SSAS 2008 Excel" scheme="http://sqlblogcasts.com/blogs/repieter/archive/tags/SSAS+2008+Excel/default.aspx" /></entry><entry><title>SQL - Wrong results in Isoweek function</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql-wrong-results-in-isoweek-function.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql-wrong-results-in-isoweek-function.aspx</id><published>2009-02-24T12:25:00Z</published><updated>2009-02-24T12:25:00Z</updated><content type="html">&lt;div&gt;See my previous post (&lt;a href="http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql2008-isoweek-in-datepart-function.aspx"&gt;http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql2008-isoweek-in-datepart-function.aspx&lt;/a&gt;)&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;In our organisation we use the ISOweek function to determine weeknumbers for a given date.&amp;nbsp;This function&amp;nbsp;appears to be&amp;nbsp;dependant of the language setting (@@DATEFIRST)&amp;nbsp;on the SQL Server. For example: January 5, 2009 should return weeknumber 2, but since the language is set to us_english&amp;nbsp;it returns weeknumber 1 for the given date. Since the weeknumber returned by this function is not correct, we needed another solution.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;We found&amp;nbsp;another sql-function&amp;nbsp;that checks&amp;nbsp;the DATEFIRST setting before it calculates the weeknumbers:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://www.rmjcs.com/SQLServer/TSQLFunctions/ISOWeekNumber/tabid/207/language/en-GB/Default.aspx"&gt;http://www.rmjcs.com/SQLServer/TSQLFunctions/ISOWeekNumber/tabid/207/language/en-GB/Default.aspx&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;This gave us the expected result.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11382" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author><category term="SQL" scheme="http://sqlblogcasts.com/blogs/repieter/archive/tags/SQL/default.aspx" /></entry><entry><title>SQL2008 - IsoWeek in Datepart function</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql2008-isoweek-in-datepart-function.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2009/02/24/sql2008-isoweek-in-datepart-function.aspx</id><published>2009-02-24T07:01:00Z</published><updated>2009-02-24T07:01:00Z</updated><content type="html">&lt;p&gt;To calculate the correct weeknumber I always used the IsoWeek function (found&amp;nbsp;here: &lt;a href="http://msdn.microsoft.com/en-us/library/aa258261(SQL.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa258261(SQL.80).aspx&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;In SQL 2008 this function is&amp;nbsp;available in&amp;nbsp;the DATEPART function:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;SELECT &lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt;DATEPART&lt;/font&gt;&lt;font color="#808080" size="2"&gt;(&lt;/font&gt;&lt;font size="2"&gt;wk&lt;/font&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;#39;4 jan 2009&amp;#39;&lt;/font&gt;&lt;font color="#808080" size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;AS&lt;/font&gt;&lt;font size="2"&gt; WeekNumber&lt;/font&gt;&lt;font color="#808080" size="2"&gt;, &lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt;DATEPART&lt;/font&gt;&lt;font color="#808080" size="2"&gt;(&lt;/font&gt;&lt;font size="2"&gt;isowk&lt;/font&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&amp;#39;4 jan 2009&amp;#39;&lt;/font&gt;&lt;font color="#808080" size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;AS&lt;/font&gt;&lt;font size="2"&gt; IsoWeekNumber&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;Output:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;
&lt;table class="" style="WIDTH:156pt;BORDER-COLLAPSE:collapse;" cellspacing="0" cellpadding="0"&gt;




&lt;tr style="HEIGHT:15pt;"&gt;
&lt;td class="" style="BORDER-RIGHT:#f0f0f0;BORDER-TOP:#f0f0f0;BORDER-LEFT:#f0f0f0;WIDTH:71pt;BORDER-BOTTOM:#f0f0f0;HEIGHT:15pt;BACKGROUND-COLOR:transparent;" height="20"&gt;&lt;font face="Calibri"&gt;WeekNumber&lt;/font&gt;&lt;/td&gt;
&lt;td class="" style="BORDER-RIGHT:#f0f0f0;BORDER-TOP:#f0f0f0;BORDER-LEFT:#f0f0f0;WIDTH:85pt;BORDER-BOTTOM:#f0f0f0;BACKGROUND-COLOR:transparent;"&gt;&lt;font face="Calibri"&gt;IsoWeekNumber&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="HEIGHT:15pt;"&gt;
&lt;td class="xl65" style="BORDER-RIGHT:#f0f0f0;BORDER-TOP:#f0f0f0;BORDER-LEFT:#f0f0f0;BORDER-BOTTOM:#f0f0f0;HEIGHT:15pt;BACKGROUND-COLOR:transparent;" height="20" class="xl65"&gt;&lt;font face="Calibri"&gt;2&lt;/font&gt;&lt;/td&gt;
&lt;td class="xl65" style="BORDER-RIGHT:#f0f0f0;BORDER-TOP:#f0f0f0;BORDER-LEFT:#f0f0f0;BORDER-BOTTOM:#f0f0f0;BACKGROUND-COLOR:transparent;" class="xl65"&gt;&lt;font face="Calibri"&gt;1&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11381" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author><category term="SQL 2008 IsoWeek" scheme="http://sqlblogcasts.com/blogs/repieter/archive/tags/SQL+2008+IsoWeek/default.aspx" /></entry><entry><title>SSIS "Failure sending mail" problem</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2008/10/01/ssis-quot-failure-sending-mail-quot-problem.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2008/10/01/ssis-quot-failure-sending-mail-quot-problem.aspx</id><published>2008-10-01T11:23:00Z</published><updated>2008-10-01T11:23:00Z</updated><content type="html">&lt;p&gt;I was trying to send an email from an SSIS package when a package failed. However, the Send Mail Task failed everytime. There was no error message except the one in the sysdtslog90 table:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;An error occurred with the following error message: &amp;quot;Failure sending mail.&amp;quot;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I found the&amp;nbsp;problem was McAfee. Here&amp;#39;s the solution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Open VirusScan Console&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Double-click &amp;#39;Access Protection&amp;#39;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Uncheck the option &amp;#39;Prevent mass mailing worms from sending mail&amp;#39;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Click Ok&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;After that, McAfee is no longer blocking the outgoing mails.&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=10851" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SQL 2005 SSAS deployment error</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2008/04/03/sql-2005-ssas-deployment-error.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2008/04/03/sql-2005-ssas-deployment-error.aspx</id><published>2008-04-03T09:14:00Z</published><updated>2008-04-03T09:14:00Z</updated><content type="html">&lt;p&gt;During a deployment of an SSAS project I got an error saying something about System.Data.Listener. The problem was that the server didn&amp;#39;t have Service Pack 1 of the .Net Framework installed. After that the problem was solved.&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=10288" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSAS2005 - Using logged in user within a role</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/12/07/ssas2005-using-logged-in-user-within-a-role.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/12/07/ssas2005-using-logged-in-user-within-a-role.aspx</id><published>2007-12-07T11:27:00Z</published><updated>2007-12-07T11:27:00Z</updated><content type="html">&lt;P&gt;A customer of ours has a security model stored in a database and they wanted to have the security in the cube to be the same, so I came up with te following solution:&lt;/P&gt;
&lt;P&gt;Example of the database in which the security is stored:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="WIDTH:451px;HEIGHT:258px;" height=258 src="http://www.inderdation.nl/PieterBlog/SecurityModel.jpg" width=451&gt;&lt;/P&gt;
&lt;P&gt;The DimUser table contains the users and their AD login account. The FactHours contains the hours that they have booked. The security is&amp;nbsp;stored in&amp;nbsp;the&amp;nbsp;many-to-many table FactHoursDimUser, so the data in this table shows which user can see which fact. Go to the "Dimension Usage"&amp;nbsp;tab to set the right relationships between the tables:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:484px;HEIGHT:166px;" height=166 src="http://www.inderdation.nl/PieterBlog/SecurityModel3.jpg" width=484&gt;&lt;/P&gt;
&lt;P&gt;Next step is to add a role to the cube and add user groups on the Membership tab.&lt;/P&gt;
&lt;P&gt;After that, you go to the dimension data tab, select the user dimension, the loginname attribute and then enter the following MDX expression to the "Allowed member set" section: {STRTOMEMBER("[User].[Loginname].[" + username+ "]")}. Also, make sure that "Enable visual totals" is enabled, so the calculations for the&amp;nbsp;totals will only show what&amp;nbsp;the logged in user is allowed to see.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:401px;HEIGHT:156px;" height=156 src="http://www.inderdation.nl/PieterBlog/SecurityModel2.jpg" width=401&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;After that, process the cube and go to the browser tab. Select "Switch user" to view the cube data with other credentials to see the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=5296" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSAS2005 - Processing failed due to collation difference</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/28/ssas2005-processing-failed-due-to-collation-difference.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/28/ssas2005-processing-failed-due-to-collation-difference.aspx</id><published>2007-11-28T14:03:00Z</published><updated>2007-11-28T14:03:00Z</updated><content type="html">&lt;P&gt;Today, I was trying to create a simple dimension, but kept getting the error "Attribute&amp;nbsp;key cannot be found". Since I was processing a dimension without any relationship to another table, I was very surprised to see this error. It appeared that there was&amp;nbsp;one record that had a column containing&amp;nbsp;the character 'ë'. When I changed this to the character 'e', everything worked. So, after checking the collation I&amp;nbsp;saw that&amp;nbsp;the relational database was Latin1_General_CP1_CI_AS and&amp;nbsp;the cube&amp;nbsp;was Latin1_General_CP1_CI_AI.&lt;/P&gt;
&lt;P&gt;So, in order to fix this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open the management studio&lt;/LI&gt;
&lt;LI&gt;Connect to the Database Engine&lt;/LI&gt;
&lt;LI&gt;Right click the Instance and select properties to see which collation is used&lt;/LI&gt;
&lt;LI&gt;Connect to the&amp;nbsp;Analysis Services&lt;/LI&gt;
&lt;LI&gt;Right-click the Instance and select properties&lt;/LI&gt;
&lt;LI&gt;Click on "Language/Collation"&lt;/LI&gt;
&lt;LI&gt;In my case:&amp;nbsp;check the box&amp;nbsp;"Accent-Sensitive"&lt;/LI&gt;
&lt;LI&gt;Click Ok&lt;/LI&gt;
&lt;LI&gt;Restart the SQL Server service&lt;/LI&gt;
&lt;LI&gt;Restart the Analysis Services service&lt;/LI&gt;
&lt;LI&gt;Re-deploy the Analysis Services database&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;After that it worked. I guess the person who installed the software didn't select the default settings (?)&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=4904" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SQL - Ordered list of tables for inserts</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/22/sql-ordered-list-of-tables-for-inserts.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/22/sql-ordered-list-of-tables-for-inserts.aspx</id><published>2007-11-22T12:00:00Z</published><updated>2007-11-22T12:00:00Z</updated><content type="html">&lt;P&gt;I'm writing an sql script that automatically inserts "Unknown" records in dimension tables. Since there are foreign key constraints in the datawarehouse, I needed to have a&amp;nbsp;list of tables in the right order, so I wouldn't get an integrity violation. The following scripts seems to be the answer:&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;WITH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt; AllTables &lt;SPAN style="COLOR:gray;"&gt;(&lt;/SPAN&gt;TableId&lt;SPAN style="COLOR:gray;"&gt;,&lt;/SPAN&gt; TableName&lt;SPAN style="COLOR:gray;"&gt;,&lt;/SPAN&gt; ParentTableId&lt;SPAN style="COLOR:gray;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;so&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;id&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;so&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;name&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;sr&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;rkeyid&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt; sysobjects so&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN style="COLOR:gray;"&gt;OUTER&lt;/SPAN&gt; &lt;SPAN style="COLOR:gray;"&gt;JOIN&lt;/SPAN&gt; sysreferences sr &lt;SPAN style="COLOR:blue;"&gt;ON&lt;/SPAN&gt; sr&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;fkeyid &lt;SPAN style="COLOR:gray;"&gt;=&lt;/SPAN&gt; so&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;id&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WHERE&lt;/SPAN&gt; so&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;xtype &lt;SPAN style="COLOR:gray;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;'U'&lt;/SPAN&gt; &lt;SPAN style="COLOR:gray;"&gt;AND&lt;/SPAN&gt; so&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;name &lt;SPAN style="COLOR:gray;"&gt;LIKE&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;'Dim%'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&gt;TableList &lt;SPAN style="COLOR:gray;"&gt;(&lt;/SPAN&gt;TableId&lt;SPAN style="COLOR:gray;"&gt;,&lt;/SPAN&gt; TableName&lt;SPAN style="COLOR:gray;"&gt;,&lt;/SPAN&gt; ParentTableId&lt;SPAN style="COLOR:gray;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableName&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;FROM&lt;/SPAN&gt; AllTables at&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WHERE&lt;/SPAN&gt; ParentTableId &lt;SPAN style="COLOR:gray;"&gt;IS&lt;/SPAN&gt; &lt;SPAN style="COLOR:gray;"&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;UNION ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableName&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;FROM&lt;/SPAN&gt; AllTables at&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WHERE&lt;/SPAN&gt; at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId &lt;SPAN style="COLOR:gray;"&gt;=&lt;/SPAN&gt; at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;UNION ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableName&lt;SPAN style="COLOR:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;FROM&lt;/SPAN&gt; AllTables at&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;INNER&lt;/SPAN&gt; &lt;SPAN style="COLOR:gray;"&gt;JOIN&lt;/SPAN&gt; TableList tl &lt;SPAN style="COLOR:blue;"&gt;ON&lt;/SPAN&gt; tl&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId &lt;SPAN style="COLOR:gray;"&gt;=&lt;/SPAN&gt; at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WHERE&lt;/SPAN&gt; at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;TableId &lt;SPAN style="COLOR:gray;"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; at&lt;SPAN style="COLOR:gray;"&gt;.&lt;/SPAN&gt;ParentTableId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:'Courier New';mso-ansi-language:EN-US;mso-no-proof:yes;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:gray;"&gt;*&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; TableList&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;NOTE:&amp;nbsp;I used&amp;nbsp;a WHERE-clause&amp;nbsp;on the table names, since I use a naming convention where dimension tables always start with 'Dim'&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=4532" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SQL - How to add leading zeros to a column</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/15/sql-how-to-fill-up-a-column.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/15/sql-how-to-fill-up-a-column.aspx</id><published>2007-11-15T08:53:00Z</published><updated>2007-11-15T08:53:00Z</updated><content type="html">&lt;P&gt;I needed to have a column that has a fixed length of 5 characters. The rest had to be filled up with zeros. Example:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;SELECT&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;m&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;MemberId&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;RIGHT(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'0'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 10&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;CONVERT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; m&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;MemberId&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; 5&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;AS&lt;/FONT&gt;&lt;FONT size=2&gt; MemberCode&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; Member m&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Output:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;MemberId MemberCode&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;1&amp;nbsp;00001&lt;BR&gt;2&amp;nbsp;00002&lt;BR&gt;3&amp;nbsp;00003&lt;BR&gt;9&amp;nbsp;00009&lt;BR&gt;10&amp;nbsp;00010&lt;BR&gt;11&amp;nbsp;00011&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=4019" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSAS2008 - Create a new dimension</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/14/ssas2008-create-a-new-dimension.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/14/ssas2008-create-a-new-dimension.aspx</id><published>2007-11-14T15:25:00Z</published><updated>2007-11-14T15:25:00Z</updated><content type="html">&lt;P&gt;Just installed the SQL Server 2008 July&amp;nbsp;CTP and started to play... Thought it'd be nice to throw it at you here... the first thing I did:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I created a simple table Member(MemberId, MemberName, MemberType) in my new Test database&amp;nbsp;and put some test data in it.&lt;/LI&gt;
&lt;LI&gt;Fired up the BIDS and created a new Analysis Services project&lt;/LI&gt;
&lt;LI&gt;Created a new dimension and saw some new things:&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="WIDTH:500px;HEIGHT:449px;" height=449 src="http://www.inderdation.nl/PieterBlog/SelectCreationMethod.jpg" width=500&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I just wanted to create a&amp;nbsp;dimension on the Member table, so I clicked Next a couple of times to finish the dimension&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The first thing&amp;nbsp;I saw&amp;nbsp;- besides the new tab page for Attribute Relationships - was the blue line under Member. This was caused by the following message: "Create hierarchies in non-parent child dimension". So... I dragged the MemberType and MemberName&amp;nbsp;property of my dimension to&amp;nbsp;a hierarchy and gave it the name "MemberType - MemberName".&lt;/P&gt;
&lt;P&gt;The blue line was still there, but now saying: "Avoid visible attribute hierarchies for attributes used as levels in user defined hierarchies". In order to make sure this warning goes away, you need to change the AttributeHierarchyVisible property of the attributes to False.&lt;/P&gt;
&lt;P&gt;Since I created a hierarchy,&amp;nbsp;I now need to define attribute relationships. This is easily done on the Attribute Relationships tabpage (I really like this new feature):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="WIDTH:620px;HEIGHT:516px;" height=516 src="http://www.inderdation.nl/PieterBlog/AttributeRelationships.jpg" width=620&gt;&lt;/P&gt;
&lt;P&gt;Be sure to set the appropriate relationships to Rigid. Not sure for which ones this has to be done... I now changed the bottom one and the warning about this (another blue line on the Dimension Structure tab) disappeared. &lt;/P&gt;
&lt;P&gt;Also, I changed the key column of the MemberName attribute by adding MemberType to it, to make MemberName and MemberType a unique combination. Although I'm not sure if this is still needed in&amp;nbsp;Sql2008 because I didn't see any warning for this...&lt;/P&gt;
&lt;P&gt;After processing the dimension and browsing the data everything looks fine.&amp;nbsp;I must say that I like the new features so far and I&amp;nbsp;will look into all new stuff in the near future to see if I can find out how it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=3969" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSAS2005 - Creating folders for calculations</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/13/ssas2005-creating-folders-for-calculations.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/13/ssas2005-creating-folders-for-calculations.aspx</id><published>2007-11-13T09:38:00Z</published><updated>2007-11-13T09:38:00Z</updated><content type="html">&lt;P&gt;A quick reminder for myself, because otherwise I forget where to do this:&lt;/P&gt;
&lt;P&gt;On the calculation tab, click Calculation Properties&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:347px;HEIGHT:246px;" height=246 src="http://www.inderdation.nl/PieterBlog/CalculationPropertiesButton.jpg" width=347&gt;&lt;/P&gt;
&lt;P&gt;Enter a name for the DisplayFolder of the calculations:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:723px;HEIGHT:556px;" height=556 src="http://www.inderdation.nl/PieterBlog/CalculationProperties.jpg" width=723&gt;&lt;/P&gt;
&lt;P&gt;The result:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:439px;HEIGHT:333px;" height=333 src="http://www.inderdation.nl/PieterBlog/CalculationFolder.jpg" width=439&gt;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=3878" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSAS2005 - Cube performance</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/11/13/ssas2005-cube-performance.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/11/13/ssas2005-cube-performance.aspx</id><published>2007-11-13T09:15:00Z</published><updated>2007-11-13T09:15:00Z</updated><content type="html">&lt;P&gt;When you're using calculations in your cube, don't forget to set the "Non-empty behaviour" property of the calculation to give a little boost to the performance...&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:777px;HEIGHT:522px;" height=522 src="http://www.inderdation.nl/PieterBlog/NonEmptyBehaviour.jpg" width=777&gt;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=3877" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry><entry><title>SSRS - Report filter based on logged in user account</title><link rel="alternate" type="text/html" href="http://sqlblogcasts.com/blogs/repieter/archive/2007/10/23/ssrs-report-filter-based-on-logged-in-user-account.aspx" /><id>http://sqlblogcasts.com/blogs/repieter/archive/2007/10/23/ssrs-report-filter-based-on-logged-in-user-account.aspx</id><published>2007-10-23T10:53:00Z</published><updated>2007-10-23T10:53:00Z</updated><content type="html">&lt;P&gt;For a report in our organisation we wanted to have the filtering in the report to be based on the login name of the user. The&amp;nbsp;data source is an SSAS cube, so we solved&amp;nbsp;it by adding the AD login name&amp;nbsp;to the Employee dimension and adding a filter to the report in which we put the login name with MDX.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Just create a new report and setup a filter&lt;/LI&gt;
&lt;LI&gt;Select the Employee dimension&lt;/LI&gt;
&lt;LI&gt;Select the attribute for the&amp;nbsp;login name&lt;/LI&gt;
&lt;LI&gt;For the operator, select MDX&lt;/LI&gt;
&lt;LI&gt;Enter the following expression: &lt;STRONG&gt;STRTOMEMBER("[Employee].[Login Name].[" + username + "]")&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title=ReportBasedOnADLoginname style="WIDTH:1056px;HEIGHT:411px;" height=411 alt=ReportBasedOnADLoginname src="http://www.xs4all.nl/~aoerlema/ReportBasedOnADLoginName.jpg" width=1056 align=left&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=2921" width="1" height="1"&gt;</content><author><name>Repieter</name><uri>http://sqlblogcasts.com/members/Repieter.aspx</uri></author></entry></feed>