<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4701270203513738041</atom:id><lastBuildDate>Fri, 18 Nov 2011 08:49:14 +0000</lastBuildDate><category>SSAS</category><category>SSRS</category><category>VB.NET</category><category>TSQL Programming</category><category>Running SSIS on X64</category><category>SSIS</category><category>Oracle</category><category>T-SQL Programming</category><category>Data Type Casting and Conversions</category><category>Sql Server 2008 February CTP-6</category><category>SSIS 2008 February CTP-6</category><category>Sql Server 2005</category><category>Sql Server 2005 Installation Issues</category><title>Subhash Subramanyam' s BI Blog</title><description>I felt it's useful to post blogs on Topic of Interests on Microsoft Sql Server BI, Technical articles and links, Issues and Workarounds came across while working on Projects. Thanks for those who visit my blog. By the way, Please post your feedback if it was useful to you..</description><link>http://subhashsubramanyam.blogspot.com/</link><managingEditor>noreply@blogger.com (Subhash Subramanyam)</managingEditor><generator>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/subhashsubramanyam" /><feedburner:info uri="subhashsubramanyam" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-1393597940533677861</guid><pubDate>Wed, 21 Sep 2011 12:16:00 +0000</pubDate><atom:updated>2011-09-21T05:16:38.491-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Some Shortcuts in SSMS Query Editor</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
List of Shortcuts which you can use while using SSMS Query editor.&lt;br /&gt;
1) Ctrl+Shift+Q -&amp;gt; Pops up the Query Builder&lt;br /&gt;
2) &lt;tablename&gt;Highlight and Press Alt+ F1 Brings all the structural details for which an equivalent replacement is sp_help&lt;br /&gt;
3) sp_helptext 'SPName' for scripting out the code contents of a Procedure.&lt;br /&gt;
4) Ctrl+K, then Ctrl+C to comment lines&lt;br /&gt;
5) Ctrl+K, then Ctrl+U to uncomment lines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;span style="font-size: 0px;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-1393597940533677861?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2008/06/some-shortcuts-in-ssms-query-editor.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-7262907238575698667</guid><pubDate>Wed, 21 Sep 2011 12:13:00 +0000</pubDate><atom:updated>2011-09-21T05:16:53.134-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSRS</category><title>Few SSRS Issues and Workarounds I encountered</title><description>&lt;div class="Section1"&gt; &lt;p class="MsoNormal" style="margin-right:284.25pt"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;SSRS 2005:&lt;/span&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="991" style="width:743.25pt;margin-left:-1.15pt;border-collapse:collapse"&gt; &lt;tbody&gt; &lt;tr style="height:15.0pt"&gt; &lt;td width="42" nowrap="" valign="top" style="width:31.8pt;border:solid windowtext 1.0pt;   border-right:none;background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Sno&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="193" nowrap="" valign="top" style="width:144.45pt;border:solid windowtext 1.0pt;   background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Problem/ Issue&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="756" nowrap="" valign="top" style="width:567.0pt;border:solid windowtext 1.0pt;   border-left:none;background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Workaround / Comments&lt;span style="color:#1F497D"&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;&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;&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;&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; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:255.0pt"&gt; &lt;td width="42" valign="top" style="width:31.8pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:255.0pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="193" valign="top" style="width:144.45pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:255.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Once the data is exported to excel, few columns are merged in the excel sheet. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="756" valign="top" style="width:567.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:255.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;a. Keep the header into excel header&lt;br&gt; This can be done by including SimplePageHeaders=true in device info. Another tips is to remove the blank columns by adding RemoveSpace item in device info.&lt;br&gt; &lt;br&gt; A sample of reconfiguring device info thro Reportserver.config is pasted below.&lt;br&gt; &lt;br&gt; &amp;lt;Extension Name=&amp;quot;EXCEL&amp;quot; Type=&amp;quot;Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering&amp;quot;&amp;gt;&lt;br&gt; &amp;lt;Configuration&amp;gt;&lt;br&gt; &amp;lt;DeviceInfo&amp;gt;&lt;br&gt; &amp;lt;SimplePageHeaders&amp;gt;true&amp;lt;/SimplePageHeaders&amp;gt;&lt;br&gt; &amp;lt;RemoveSpace&amp;gt;0.012in&amp;lt;/RemoveSpace&amp;gt;&lt;br&gt; &amp;lt;/DeviceInfo&amp;gt;&lt;br&gt; &amp;lt;/Configuration&amp;gt;&lt;br&gt; &amp;lt;/Extension&amp;gt;&lt;br&gt; &lt;br&gt; &lt;br&gt; b. Change width to points&lt;br&gt; c. Left and right edges of all report items line up with each other.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:114.75pt"&gt; &lt;td width="42" valign="top" style="width:31.8pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:114.75pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="193" valign="top" style="width:144.45pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:114.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;1. Table control header contents within Matrix Row header will not be displayed in Excel export. &lt;br&gt; 2. Interactive Sorting in Matrix,&lt;br&gt; 3. Hiding columns in matrix due to inavailability of Visibility property &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="756" valign="top" style="width:567.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:114.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;These are limitations in 2005 edition. Try to get the display of the Matrix in Dataset itself by modifying SQL script and use Table instead. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:246.75pt"&gt; &lt;td width="42" valign="top" style="width:31.8pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:246.75pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="193" valign="top" style="width:144.45pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:246.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;You may have learned about sparklines or you want to add a chart to your Tablix.&amp;nbsp; You either copy/paste your working(!!!) chart into the tablix and then you preview and you  get:&lt;br&gt; &lt;br&gt; &amp;quot;The chart 'Chart1' has a detail member with inner members.&amp;nbsp; Detail members can only contain static inner members.&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="756" valign="top" style="width:567.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:246.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;It is a simple logic behind. The chart you are adding already have categories/series axis which is going to grow dynamically, now when you put this chart inside a detail level  row of a tablix it is going to throw the below error. You should add the chart in the group header level, in that way the chart gets replicated w.r.t each group item in the tablix. For example &amp;#8220;Product Category&amp;#8221; can be row header in the tablix and the chart  categories/series can have &amp;#8220;Product&amp;#8221;. Suman.sundar@accenture.com.&lt;br&gt; In a Tablix you cannot put dynamic member in a Detail row.&amp;nbsp; You have to put it into a Group header or Group Footer row. &lt;br&gt; &lt;br&gt; Steps:&lt;br&gt; &lt;br&gt; 1.Insert a table into your report. &lt;br&gt; 2.Set the DataSetName for the Tablix (either in the Properties pane or by dragging a field into the tablix). &lt;br&gt; 3.In Row Groups, right click the (Details1) group.&amp;nbsp; Select Add Group &amp;#8211;&amp;gt; Parent Group&amp;#8230; &lt;br&gt; 4.In the Tablix group dialog, Select your Group by: clause.&amp;nbsp; &lt;br&gt; 5.Check the Add group header checkbox. &lt;br&gt; 6.Press OK. &lt;br&gt; Notice the two rows next to big parenthesis on the left.&amp;nbsp; These are the rows in your group.&amp;nbsp; The top row (where I has the highlighted cell) is the group&amp;nbsp; header row.&amp;nbsp; You can put a chart in any group header row.&amp;nbsp;&amp;nbsp; The bottom row (where the three link icon is)  is the details row.&amp;nbsp; If you put your chart in this row, you will get the aforementioned error.&amp;nbsp; From&amp;nbsp; http://blogs.msdn.com/b/lukaszp/archive/2009/12/21/charts-in-a-tablix-cell-don-t-work-for-me-but-i-ve-see-these-nice-demos-where-they-do.aspx&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:102.0pt"&gt; &lt;td width="42" valign="top" style="width:31.8pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:102.0pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="193" valign="top" style="width:144.45pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:102.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Determine number of Columns shown in matrix&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="756" valign="top" style="width:567.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:102.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Would you be able to do a count on the dataset to get your column count?&lt;br&gt; &lt;br&gt; Count(Fields!FieldUsedAsColumnGrouping.Value,&amp;quot;DatasetName&amp;quot;)&lt;br&gt; Not sure how your data and matrix are setup, I do something similar where I have to know the number of columns so that I can draw an appropriate border line. But I think you should be able to a Count on either the dataset or grouping to get what you are looking  for. (I can paste some code come Monday if needed.). From http://stackoverflow.com/questions/495174/reporting-services-determine-number-of-columns-shown-in-matrix&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;SSRS 2008:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="987" style="width:740.0pt;margin-left:-1.15pt;border-collapse:collapse"&gt; &lt;tbody&gt; &lt;tr style="height:15.0pt"&gt; &lt;td width="37" nowrap="" valign="top" style="width:28.0pt;border:solid windowtext 1.0pt;   border-right:none;background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;SNo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" nowrap="" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Issues&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" nowrap="" valign="top" style="width:431.0pt;border:solid windowtext 1.0pt;   border-left:none;background:silver;padding:0in 5.4pt 0in 5.4pt;height:15.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Workaround&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:63.75pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:63.75pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:63.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Does not display all the Labels on the axis of a Bar Chart&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:63.75pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Check one of the following :&lt;br&gt; 1. Select X-Axis (where we show task names example) -&amp;gt; Right Click Axis Properties -&amp;gt; Axis Options -&amp;gt; check the option &amp;quot;Enable Variable Interval&amp;quot;.&lt;br&gt; 2. Right click on the chart, Click Show Data Labels&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:64.5pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:64.5pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:64.5pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Column Headers in pages are not repeating and they appear only in first page. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:64.5pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Choose Advanced Mode in the Grouping pane (Click on V Button near Column Groups, Select Advanced Mode). Select &amp;quot;Static&amp;quot; that appear under Row Groups,Go to Properties Pane by  pressing F4. Under the Properties List, Set the value True for &lt;b&gt;FixedData&lt;/b&gt; and &lt;b&gt;RepeatOnNewPage.&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:312.0pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:312.0pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:312.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Query Execution Failed for Dataset &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:312.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Check one of the following:&lt;br&gt; 1. Remove or comment those Declared variables which is already in the Parameters list&lt;br&gt; 2. If the Stored Procedure was not set to public in the properties section,it will work on local computer but not on the report server. (Right click the stored procedure in Sql server, and click properties, when the box opens up , select Permissions and click  add, type in public and click ok.)&lt;br&gt; 3. Increase the SessionTimeout on the SQL Server Reporting Service server to extend the time the session is alive which can increase the time before a failure could occur.Please follow the detailed steps:&lt;br&gt; &amp;nbsp;a) Open Report Manager using http://&amp;lt;servername&amp;gt;/Reports. &lt;br&gt; &amp;nbsp;b) Navigate to the specific report, and then click the tab &amp;#8220;Properties&amp;#8221;.&lt;br&gt; &amp;nbsp;c) In &amp;#8220;Properties&amp;#8221; tab, click &amp;#8220;Execution&amp;#8221;&lt;br&gt; &amp;nbsp;d) Then, select &amp;#8220;Limit report execution to the following number of seconds:&amp;#8221;, and set it to a new value.&lt;br&gt; 4. If the step3 does not help, please use the following steps: &lt;br&gt; &amp;nbsp;a) Please run the Query string of DataSet in SQL Server Manager Studio, and then check if there have Dead locks in SQL Server&lt;br&gt; &amp;nbsp;b) If so, please re-design the Query String, or optimization the database.&lt;br&gt; &amp;nbsp;c) If not, try rebuilding the report.&lt;br&gt; 5. Make sure that the dataset name is changed everywhere in the report layout, not only in the data tab. All the controls in the report will be pointing to the old dataset name, change these.&lt;br&gt; 6. If you are viewing the report and then you update it, there is some metadata which needs to be rebound when you press the View Report button.&amp;nbsp; This doesn't get rebound correctly.&amp;nbsp; &lt;br&gt; The solution is to navigate back to the folder containing the report and run it again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:25.5pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:25.5pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:25.5pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Display Total Rows for the Dataset. Show table based on record count, hide the table when row count is 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:25.5pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Add &amp;quot;=CountRows(&amp;quot;DataSetName&amp;quot;)=0&amp;quot; in the Visibility expression does the trick&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:51.0pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:51.0pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:51.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&amp;quot;Unclosed Quotation Mark&amp;quot; or &amp;quot;Incorrect Syntax near&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:51.0pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Possible Causes:1) The Column values that are part of IN filter may contain a quote - Eliminate these quotes using REPLACE function. 2) While using Dynamic SQL, the Column  values built for IN Criteria assigned to a VARCHAR Variable getting truncated due to limitation of the length -&amp;nbsp; All IN filters should be cascaded directly to the EXEC Statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:38.25pt"&gt; &lt;td width="37" valign="top" style="width:28.0pt;border-top:none;border-left:solid windowtext 1.0pt;   border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 5.4pt 0in 5.4pt;   height:38.25pt"&gt; &lt;p class="MsoNormal" align="right" style="text-align:right"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;6&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="375" valign="top" style="width:281.0pt;border:solid windowtext 1.0pt;   border-top:none;padding:0in 5.4pt 0in 5.4pt;height:38.25pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;Report when exported as Pdf inserts alternate blank pages &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td width="575" valign="top" style="width:431.0pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:38.25pt"&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;1. Adjust the Page width by resisizing text, label and other object placed on the report&lt;br&gt; 2. In the Report Properties -&amp;gt; Page set up -&amp;gt; Adjust the Margins, set Left = 1.5cm , right = 0cm, top = 0cm and bottom = 0cm&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p class="MsoNormal" align="center" style="text-align:center"&gt;&lt;span style="font-size:12.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size:12.0pt"&gt;Thanks and Regards,&lt;br&gt; &lt;b&gt;Subhash Subramanyam&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:12.0pt;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;/div&gt; &lt;br&gt; &lt;hr&gt; &lt;font face="Arial" color="Gray" size="2"&gt;This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.&lt;br&gt; &lt;/font&gt; &lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-7262907238575698667?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2011/09/few-ssrs-issues-and-workarounds-i_21.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-2001270882386807499</guid><pubDate>Thu, 04 Jun 2009 05:28:00 +0000</pubDate><atom:updated>2011-09-21T07:18:39.779-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Converting non-ansi *= or =*  to SQL 92 type / ansi joins</title><description>Not only such a tool doesn't exist but I would suggest that for thosequeries with more than a single left or right outer join, you really doublecheck the result of your translation to see if they are really OK. You may notice SQL Server 2000 Query Analyzer on higher versions does its best to convert the non-ansi sql code to ansi easily. However you cannot rely on this conversion results unless you verify. Remember there are some post conversion steps:&lt;br /&gt;&lt;br /&gt;1. Identify tables participating in outer joins and make sure that all columns addressed for these tables in the WHERE clause should move to JOIN clause. - Hari Suthan, DBA, CTE&lt;br /&gt;&lt;br /&gt;2. Since Sql Server 2000 databases are compatible with both ANSI and NON ANSI queries, you can test both legacy and converted code with this version. - Khushwanth, Business Analyst, CTE&lt;br /&gt;&lt;br /&gt;3. Beware of changing queries that are part of branches, Validate results for every branch and see if the results for legacy and the ANSI converted are same.&lt;br /&gt;&lt;br /&gt;4. You may want check out for another converison tool called SwisSQL Console 4.2 that can be downloaded from - &lt;a href="http://www.swissql.com/products/sql-translator/sql-converter.html"&gt;http://www.swissql.com/products/sql-translator/sql-converter.html&lt;/a&gt;&lt;br /&gt;(Transact SQL Forums ).&lt;br /&gt;will be adding more as I come across scenarios ...&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Subhash Subramanyam&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-2001270882386807499?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/06/converting-non-ansi-or-to-sql-92-type.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>6</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-4196786024838556008</guid><pubDate>Sat, 04 Apr 2009 03:04:00 +0000</pubDate><atom:updated>2009-04-04T15:05:15.342-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Did you know that ISNULL function can take Query as a parameter ?</title><description>&lt;p&gt;I found it tricky to write a single query to achieve a task given by Geetansu Behera. The question can be instantiated as below:&lt;/p&gt;&lt;p&gt;CityID CityName CityDescription&lt;/p&gt;&lt;p&gt;-----------------------------------------------&lt;/p&gt;&lt;p&gt;2 WA Washington&lt;/p&gt;&lt;p&gt;3 CH Chicago&lt;/p&gt;&lt;p&gt;4 OH Ohio&lt;/p&gt;&lt;p&gt;NULL CA California &lt;/p&gt;&lt;p&gt;99 US United States&lt;/p&gt;&lt;p&gt;He wants a query that should return maximum value of CityID if a particular CityDescription all in a single query. Geetansu gave me the first one and I worked it out another way. Many thanks if you could post some new way around:&lt;/p&gt;&lt;p&gt;1) SELECT ISNULL((SELECT CityID FROM City WHERE CityDescription LIKE 'New York') , (SELECT MAX(CityID) FROM City))&lt;/p&gt;&lt;p&gt;OR&lt;/p&gt;&lt;p&gt;2) SELECT CASE WHEN CityID IS NULL THEN MaxCityID ELSE CityID END 'CityID' FROM (SELECT (SELECT CityID FROM City WHERE CityDescription LIKE 'New York') CityID, (SELECT MAX(CityID) FROM City) MaxCityID) B&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-4196786024838556008?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/04/did-you-know-that-isnull-function-can.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-5149580157363016619</guid><pubDate>Fri, 03 Apr 2009 14:56:00 +0000</pubDate><atom:updated>2009-04-03T20:28:33.568-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">TSQL Programming</category><title>System Table Queries (2000)</title><description>&lt;a href="http://www.blogger.com/www.subhashsubramanyam.blogspot.com"&gt;&lt;/a&gt;&lt;br /&gt;-- 1) Transact-SQL script to report which columns are identity columns:&lt;br /&gt;SELECT O.name, C.name from sysobjects O&lt;br /&gt;INNER JOIN syscolumns C on O.id = C.id&lt;br /&gt;WHERE o.type='U' AND objectproperty (o.id, 'TABLEHASIDENTITY') = 1&lt;br /&gt;AND columnproperty (o.id, c.name, 'IsIdentity') = 1&lt;br /&gt;ORDER BY O.name, C.name&lt;br /&gt;&lt;br /&gt;-- 2) Transact-SQL script to report which tables have triggers&lt;br /&gt;SELECT O.name from sysobjects O&lt;br /&gt;WHERE&lt;br /&gt;o.type='U' AND (objectproperty (o.id, 'TableHasDeleteTrigger') = 1&lt;br /&gt;OR objectproperty (o.id, 'TableHasInsertTrigger') = 1&lt;br /&gt;OR objectproperty (o.id, 'TableHasUpdateTrigger') = 1)&lt;br /&gt;ORDER BY O.name&lt;br /&gt;&lt;br /&gt;-- 3) Transact-SQL script to report which tables do not have primary keys&lt;br /&gt;SELECT O.name from sysobjects OWHERE o.type='U' AND objectproperty (o.id, 'TableHasPrimaryKey') = 0ORDER BY O.name&lt;br /&gt;&lt;br /&gt;--4) Transact-SQL script to report which tables have identity columns or time stamps:&lt;br /&gt;SELECT O.name from sysobjects O&lt;br /&gt;WHERE o.type='U' AND (objectproperty (o.id, 'TableHasIdentity') = 1&lt;br /&gt;OR objectproperty (o.id, 'TableHasTimestamp') = 1)&lt;br /&gt;ORDER BY O.name&lt;br /&gt;&lt;blockquote&gt; &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-5149580157363016619?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/04/system-table-queries-2000.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-5906985754265607708</guid><pubDate>Sun, 29 Mar 2009 22:20:00 +0000</pubDate><atom:updated>2009-04-04T15:06:40.300-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">VB.NET</category><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Passing DataTable into a StoredProcedure</title><description>&lt;a href="http://www.blogger.com/www.subhashsubramanyam.blogspot.com"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;p&gt;Thanks to Geetanshu Behera who informed me to try this.&lt;/p&gt;&lt;p&gt;-- Run this into one of your Database&lt;br /&gt;-- 1. Create a table to populate via our StoredProcedure&lt;br /&gt;&lt;br /&gt;CREATE TABLE Artist&lt;br /&gt;(&lt;br /&gt;[Artist#] int Primary Key Identity,&lt;br /&gt;[Name] Varchar(50) Not Null&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;-- 2. Create a tabletype for Passing the DataTable&lt;br /&gt;CREATE TYPE ArtistType AS TABLE (&lt;br /&gt;[Name] varchar(100) NOT NULL&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- 3. Create Procedure that Populates a Table and&lt;br /&gt;CREATE PROCEDURE [dbo].[AddShoppings](&lt;br /&gt;@Artists dbo.ArtistType READONLY&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;-- variables to use&lt;br /&gt;DECLARE @name varchar(100);&lt;br /&gt;&lt;br /&gt;-- cursor for artists parameter&lt;br /&gt;DECLARE artistCursor CURSOR FOR SELECT [Name] FROM @Artists;&lt;br /&gt;-- loop through artists&lt;br /&gt;OPEN artistCursor;&lt;br /&gt;FETCH NEXT FROM artistCursor INTO @name;&lt;br /&gt;WHILE @@FETCH_STATUS = 0 BEGIN&lt;br /&gt;-- insert the artist&lt;br /&gt;INSERT INTO Artist ([Name]) VALUES (@name);&lt;br /&gt;FETCH NEXT FROM artistCursor INTO @name;&lt;br /&gt;END;&lt;br /&gt;CLOSE artistCursor;&lt;br /&gt;-- clean-up&lt;br /&gt;DEALLOCATE artistCursor;&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- 6. Modify the ConnectionString in the below code (VB.NET) to Point to your Database&lt;br /&gt;&lt;br /&gt;Imports System.Collections&lt;br /&gt;Imports System.Data.SqlClient&lt;br /&gt;Imports System.Data&lt;br /&gt;&lt;br /&gt;Public Module PassingDataTableIntostoredProcedure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Public Sub Main()&lt;br /&gt;Dim connectionString As String = "Data Source=SUBHASH;Initial Catalog=A;Integrated Security=SSPI;"&lt;br /&gt;InsertArticle(connectionString)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Sub InsertArticle(ByVal connectionString As String)&lt;br /&gt;Try&lt;br /&gt;Dim CommandText As String = "AddShoppings"&lt;br /&gt;Dim connection As New SqlConnection(connectionString)&lt;br /&gt;Dim Command As New SqlCommand(CommandText, connection)&lt;br /&gt;connection.Open()&lt;br /&gt;Dim artist As New DataTable&lt;br /&gt;Dim dcol As DataColumn&lt;br /&gt;Dim drow As DataRow&lt;br /&gt;&lt;br /&gt;' Create new DataColumn, set DataType, ColumnName&lt;br /&gt;' and add to DataTable.&lt;br /&gt;dcol = New DataColumn()&lt;br /&gt;dcol.DataType = System.Type.GetType("System.String")&lt;br /&gt;dcol.ColumnName = "Name"&lt;br /&gt;dcol.Caption = "Name"&lt;br /&gt;'dcol.AutoIncrement = True&lt;br /&gt;'dcol.AutoIncrementSeed = 1&lt;br /&gt;'dcol.AutoIncrement = True&lt;br /&gt;'dcol.AutoIncrementStep = 1&lt;br /&gt;dcol.ReadOnly = True&lt;br /&gt;dcol.Unique = True&lt;br /&gt;&lt;br /&gt;' Add the Column to the DataColumnCollection.&lt;br /&gt;artist.Columns.Add(dcol)&lt;br /&gt;&lt;br /&gt;'' Create second column.&lt;br /&gt;'dcol = New DataColumn()&lt;br /&gt;'dcol.DataType = System.Type.GetType("System.String")&lt;br /&gt;'dcol.ColumnName = "Name"&lt;br /&gt;'dcol.AutoIncrement = False&lt;br /&gt;'dcol.Caption = "Nme"&lt;br /&gt;'dcol.ReadOnly = False&lt;br /&gt;'dcol.Unique = False&lt;br /&gt;&lt;br /&gt;'' Add the column to the table.&lt;br /&gt;'artist.Columns.Add(dcol)&lt;br /&gt;&lt;br /&gt;' Create three new DataRow objects and add&lt;br /&gt;' them to the DataTable&lt;br /&gt;Dim i As Integer&lt;br /&gt;For i = 0 To 2&lt;br /&gt;drow = artist.NewRow()&lt;br /&gt;' drow("Artist#") = i&lt;br /&gt;drow("Name") = "NameValue - " + i.ToString()&lt;br /&gt;artist.Rows.Add(drow)&lt;br /&gt;Next i&lt;br /&gt;&lt;br /&gt;'Adding New Data Rows&lt;br /&gt;'Dim dr1, dr2, dr3 As DataRow&lt;br /&gt;'dr1 = artist.NewRow&lt;br /&gt;'dr1.Item("ArtistName") = "Aaron"&lt;br /&gt;'dr2 = artist.NewRow&lt;br /&gt;'dr2.Item("ArtistName") = "Vidya"&lt;br /&gt;'dr3 = artist.NewRow&lt;br /&gt;'dr3.Item("ArtistName") = "Cameroon"&lt;br /&gt;&lt;br /&gt;Command.CommandType = CommandType.StoredProcedure&lt;br /&gt;Command.Parameters.AddWithValue("@Artists", artist)&lt;br /&gt;Command.ExecuteNonQuery()&lt;br /&gt;Console.WriteLine("Passing DataTable into Stored Procedure completed")&lt;br /&gt;Console.WriteLine("Test your Table Article for data")&lt;br /&gt;Console.ReadLine()&lt;br /&gt;connection.Close()&lt;br /&gt;&lt;br /&gt;Catch ex As Exception&lt;br /&gt;&lt;br /&gt;End Try&lt;br /&gt;End Sub 'End Of InsertArticle Procedure&lt;br /&gt;&lt;br /&gt;End Module 'End of PassingDataTableIntostoredProcedure Module&lt;br /&gt;&lt;br /&gt;-- 7. Run the Code.&lt;br /&gt;-- 8. Check if the Table Artist is populated&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-5906985754265607708?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/03/passing-datatable-into-storedprocedure.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-8139647358468144495</guid><pubDate>Thu, 19 Mar 2009 13:49:00 +0000</pubDate><atom:updated>2009-04-26T08:13:54.909-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>List of all Procedures and dependant Tables that are updated using linked server</title><description>&lt;blockquote&gt;&lt;p&gt;Thanks to Deana Ritter for the queries below. Used to retrieve list of all updating stored procedures where we have use of linked servers for replication.&lt;/p&gt;&lt;p&gt;Select object_name(c.id) Proc_Name , object_name(d.depid) Table_Name, d.resultobj&lt;br /&gt;From syscomments c inner join sysdepends d on c.id = d.id&lt;br /&gt;Where d.resultobj = 1 and text like '%LinkedServerName%' and Text like '%OtherDatabaseName%'&lt;br /&gt;Group by object_name(c.id) , object_name(d.depid) , d.resultobj &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-8139647358468144495?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/03/list-of-all-procedures-and-dependant.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-8047607455440397379</guid><pubDate>Wed, 18 Mar 2009 18:54:00 +0000</pubDate><atom:updated>2009-04-03T20:01:49.259-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">TSQL Programming</category><title>Query to get a list of foreign key constraints for a table</title><description>&lt;a href="http://www.blogger.com/www.subhashsubramanyam.blogspot.com"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;p&gt;SELECT&lt;br /&gt;K_Table = FK.TABLE_NAME,&lt;br /&gt;FK_Column = CU.COLUMN_NAME,&lt;br /&gt;PK_Table = PK.TABLE_NAME,&lt;br /&gt;PK_Column = PT.COLUMN_NAME,&lt;br /&gt;Constraint_Name = C.CONSTRAINT_NAME&lt;br /&gt;FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C&lt;br /&gt;INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME&lt;br /&gt;INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME&lt;br /&gt;INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME&lt;br /&gt;INNER JOIN (&lt;br /&gt;SELECT i1.TABLE_NAME, i2.COLUMN_NAME&lt;br /&gt;FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1&lt;br /&gt;INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2 ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME&lt;br /&gt;WHERE i1.CONSTRAINT_TYPE = 'PRIMARY KEY'&lt;br /&gt;) PT ON PT.TABLE_NAME = PK.TABLE_NAME&lt;br /&gt;-- optional:&lt;br /&gt;--ORDER BY&lt;br /&gt;-- 1,2,3,4&lt;br /&gt;WHERE PK.TABLE_NAME='User_table'&lt;/p&gt;&lt;p&gt;Note:  You can also see list of Foreign keys for a given table by using sp_help / highlight table with alt+f1&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-8047607455440397379?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/03/query-to-get-list-of-foreign-key.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-5478026667918927286</guid><pubDate>Tue, 03 Mar 2009 12:27:00 +0000</pubDate><atom:updated>2009-03-05T22:03:23.087-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">TSQL Programming</category><title>Keep a check on your IDENTITY columns in SQL Server</title><description>&lt;a href="http://www.blogger.com/www.subhashsubramanyam.blogspot.com"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;p&gt;Found the helpful link&lt;a href="http://vyaskn.tripod.com/sql_server_check_identity_columns.htm"&gt; here&lt;/a&gt;. Code is very helpful to have an eye on Identity columns that may be likely to encounter Arithmetic overflow error.&lt;/p&gt;&lt;p&gt;/* The SQL Server 2005 version of the stored procedure. It uses new catalog views */&lt;br /&gt;CREATE PROC dbo.CheckIdentities&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + '.' + QUOTENAME(t.name) AS TableName,&lt;br /&gt;c.name AS ColumnName,&lt;br /&gt;CASE c.system_type_id&lt;br /&gt;WHEN 127 THEN 'bigint'&lt;br /&gt;WHEN 56 THEN 'int'&lt;br /&gt;WHEN 52 THEN 'smallint'&lt;br /&gt;WHEN 48 THEN 'tinyint'&lt;br /&gt;END AS 'DataType',&lt;br /&gt;IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) AS CurrentIdentityValue,&lt;br /&gt;CASE c.system_type_id&lt;br /&gt;WHEN 127 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 9223372036854775807&lt;br /&gt;WHEN 56 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 2147483647&lt;br /&gt;WHEN 52 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 32767&lt;br /&gt;WHEN 48 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 255&lt;br /&gt;END AS 'PercentageUsed'&lt;br /&gt;FROM sys.columns AS c&lt;br /&gt;INNER JOIN&lt;br /&gt;sys.tables AS t&lt;br /&gt;ON t.[object_id] = c.[object_id]&lt;br /&gt;WHERE c.is_identity = 1&lt;br /&gt;ORDER BY PercentageUsed DESC&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you try to create the above stored procedure in SQL Server 2000, you will get the following error:&lt;br /&gt;Server: Msg 195, Level 15, State 10, Procedure a, Line 4&lt;br /&gt;'SCHEMA_NAME' is not a recognized function name.&lt;br /&gt;So, here are some SQL Server 2000 compatible versions.&lt;br /&gt;&lt;br /&gt;/* The SQL Server 2000 version of the stored procedure. Uses system tables. This should work in SQL Server 7.0 too */&lt;br /&gt;CREATE PROC dbo.CheckIdentities&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;SELECT QUOTENAME(USER_NAME(t.uid))+ '.' + QUOTENAME(t.name) AS TableName,&lt;br /&gt;c.name AS ColumnName,&lt;br /&gt;CASE c.xtype&lt;br /&gt;WHEN 127 THEN 'bigint'&lt;br /&gt;WHEN 56 THEN 'int'&lt;br /&gt;WHEN 52 THEN 'smallint'&lt;br /&gt;WHEN 48 THEN 'tinyint'&lt;br /&gt;END AS 'DataType',&lt;br /&gt;IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) AS CurrentIdentityValue,&lt;br /&gt;CASE c.xtype&lt;br /&gt;WHEN 127 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 9223372036854775807&lt;br /&gt;WHEN 56 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 2147483647&lt;br /&gt;WHEN 52 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 32767&lt;br /&gt;WHEN 48 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 255&lt;br /&gt;END AS 'PercentageUsed'&lt;br /&gt;FROM syscolumns AS c&lt;br /&gt;INNER JOIN&lt;br /&gt;sysobjects AS t&lt;br /&gt;ON t.id = c.id&lt;br /&gt;WHERE COLUMNPROPERTY(t.id, c.name, 'isIdentity') = 1&lt;br /&gt;AND OBJECTPROPERTY(t.id, 'isTable') = 1&lt;br /&gt;ORDER BY PercentageUsed DESC&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* The SQL Server 2000 version of the stored procedure. Uses INFORMATION_SCHEMA views. */&lt;br /&gt;CREATE PROC dbo.CheckIdentities&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;SELECT QUOTENAME(t.TABLE_SCHEMA) + '.' + QUOTENAME(t.TABLE_NAME) AS TableName,&lt;br /&gt;c.COLUMN_NAME AS ColumnName,&lt;br /&gt;c.DATA_TYPE AS 'DataType',&lt;br /&gt;IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) AS CurrentIdentityValue,&lt;br /&gt;CASE c.DATA_TYPE&lt;br /&gt;WHEN 'bigint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 9223372036854775807&lt;br /&gt;WHEN 'int' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 2147483647&lt;br /&gt;WHEN 'smallint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 32767&lt;br /&gt;WHEN 'tinyint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 255&lt;br /&gt;END AS 'PercentageUsed'&lt;br /&gt;FROM INFORMATION_SCHEMA.COLUMNS AS c&lt;br /&gt;INNER JOIN&lt;br /&gt;INFORMATION_SCHEMA.TABLES AS t&lt;br /&gt;ON c.TABLE_SCHEMA = t.TABLE_SCHEMA AND c.TABLE_NAME = t.TABLE_NAME&lt;br /&gt;WHERE COLUMNPROPERTY(OBJECT_ID(t.TABLE_SCHEMA + '.' + t.TABLE_NAME), c.COLUMN_NAME, 'isIdentity') = 1&lt;br /&gt;AND c.DATA_TYPE IN ('bigint', 'int', 'smallint', 'tinyint')&lt;br /&gt;AND t.TABLE_TYPE = 'BASE TABLE'&lt;br /&gt;ORDER BY PercentageUsed DESC&lt;br /&gt;END / 2147483647 WHEN 52 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 32767 WHEN 48 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 255 END AS 'PercentageUsed' FROM sys.columns AS c INNER JOIN sys.tables AS t ON t.[object_id] = c.[object_id] WHERE c.is_identity = 1 ORDER BY PercentageUsed DESC&lt;/p&gt;&lt;p&gt;END&lt;/p&gt;&lt;p&gt;If you try to create the above stored procedure in SQL Server 2000, you will get the following error:Server: Msg 195, Level 15, State 10, Procedure a, Line 4'SCHEMA_NAME' is not a recognized function name.So, here are some SQL Server 2000 compatible versions.&lt;/p&gt;&lt;p&gt;/* The SQL Server 2000 version of the stored procedure. Uses system tables. This should work in SQL Server 7.0 too */&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:+0;"&gt;CREATE PROC dbo.CheckIdentitiesASBEGIN SET NOCOUNT ON SELECT QUOTENAME(USER_NAME(t.uid))+ '.' + QUOTENAME(t.name) AS TableName, c.name AS ColumnName, CASE c.xtype WHEN 127 THEN 'bigint' WHEN 56 THEN 'int' WHEN 52 THEN 'smallint' WHEN 48 THEN 'tinyint' END AS 'DataType', IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) AS CurrentIdentityValue, CASE c.xtype WHEN 127 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 9223372036854775807 WHEN 56 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 2147483647 WHEN 52 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 32767 WHEN 48 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 255 END AS 'PercentageUsed' FROM syscolumns AS c INNER JOIN sysobjects AS t ON t.id = c.id WHERE COLUMNPROPERTY(t.id, c.name, 'isIdentity') = 1 AND OBJECTPROPERTY(t.id, 'isTable') = 1 ORDER BY PercentageUsed DESCEND&lt;/span&gt;/* The SQL Server 2000 version of the stored procedure. Uses INFORMATION_SCHEMA views. */&lt;/p&gt;&lt;p&gt;CREATE PROC dbo.CheckIdentities&lt;/p&gt;&lt;p&gt;AS&lt;/p&gt;&lt;p&gt;BEGIN SET &lt;/p&gt;&lt;p&gt;NOCOUNT ON &lt;/p&gt;&lt;p&gt;SELECT QUOTENAME(t.TABLE_SCHEMA) + '.' + QUOTENAME(t.TABLE_NAME) AS TableName, c.COLUMN_NAME AS ColumnName, c.DATA_TYPE AS 'DataType', IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) AS CurrentIdentityValue, CASE c.DATA_TYPE WHEN 'bigint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 9223372036854775807 WHEN 'int' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 2147483647 WHEN 'smallint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 32767 WHEN 'tinyint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 255 END AS 'PercentageUsed' FROM INFORMATION_SCHEMA.COLUMNS AS c INNER JOIN INFORMATION_SCHEMA.TABLES AS t ON c.TABLE_SCHEMA = t.TABLE_SCHEMA AND c.TABLE_NAME = t.TABLE_NAME WHERE COLUMNPROPERTY(OBJECT_ID(t.TABLE_SCHEMA + '.' + t.TABLE_NAME), c.COLUMN_NAME, 'isIdentity') = 1 AND c.DATA_TYPE IN ('bigint', 'int', 'smallint', 'tinyint') AND t.TABLE_TYPE = 'BASE TABLE' ORDER BY PercentageUsed DESC&lt;/p&gt;&lt;p&gt;END&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-5478026667918927286?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2009/03/keep-check-on-your-identity-columns-in.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-6238940615693018856</guid><pubDate>Fri, 28 Mar 2008 08:04:00 +0000</pubDate><atom:updated>2011-09-21T07:15:09.317-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><category domain="http://www.blogger.com/atom/ns#">SSIS 2008 February CTP-6</category><title>About Data Profiling Task in SSIS 2008</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
It was hard in the beginning to get started with the Data Profiling as I was looking for "how-to" information and happily found them all in a &lt;a href="http://blogs.conchango.com/jamiethomson/archive/2008/03/02/ssis-data-profiling-task-part-1-introduction.aspx"&gt;precise series of Jamie&lt;/a&gt; and John Welch has stepped ahead to show how the &lt;a href="http://agilebi.com/cs/blogs/jwelch/archive/2008/03/11/using-the-data-profiling-task-to-profile-all-the-tables-in-a-database.aspx"&gt;XML of Data Profiling task taken from the Package can be used to profile all the tables in a database&lt;/a&gt; (That's a clever attempt...) and Curious .. when Matt Masson will announce the release of Refresh CTP that can allow us to assign expressions directly on Data Profiling task via expression builder? Unfortunately you need to wait. In the meanwhile he has blogged about compromizing this functionality by &lt;a href="http://blogs.msdn.com/mattm/archive/2008/03/12/accessing-a-data-profile-programmatically.aspx"&gt;accessing a data Profile programmatically&lt;/a&gt; with a well commented, easy lines of code. I would like to extend here, if Microsoft can integrate the Data Profile viewer into SSIS Package (like a browser tab or dataviewer to see results on the fly) adding bit more visualization enhancements, it would be of great help.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Subhash Subramanyam&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-6238940615693018856?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2008/03/about-data-profiling-task-in-ssis-2008.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-244899044113159240</guid><pubDate>Wed, 26 Mar 2008 04:27:00 +0000</pubDate><atom:updated>2011-09-21T07:15:33.259-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><category domain="http://www.blogger.com/atom/ns#">Sql Server 2008 February CTP-6</category><title>My feedback for SQL Server 2008 February CTP-6.</title><description>&lt;blockquote&gt;&lt;p&gt;I invested my time downloading and installing this latest CTP (February 2008 release). This to make you understand why I really felt embarrassing from the beginning I installed this release. Initially I downloaded to install the 1.5 GB huge CTP on 29th of Feb. While installing the splash screen displayed November Release, I was mislead by the information that I had downloaded a wrong setup file by chance. But infact I was wrong to realize it was the same copy that I downloaded once again. Imagine that there is no means that you can help yourself saying that it's a february release and Do not worry, Refresh build will also mislead you by initially giving you a splash screen saying it's a feb release but on the main Installation page, you still see as November CTP Edition.. confusing don't you. &lt;/p&gt;&lt;p&gt;Suddenly on 2nd of March, the Sql server and Sql Server agent stopped working and you cannot start them no matter you try hard attempts for resoluton. I thought that the problem was with privileges, but not until too late that I &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2926903&amp;amp;SiteID=1"&gt;found the solution here&lt;/a&gt; that we need to install the build available after 29th of feb. I re-installed the fresh build and got ultimately disappointed when I saw that Installation failed - Database Engine and Reporting Services failed. Then I scanned through the logs to understand all the internal things that went on during installation and reason why Pre CTP-6 didn't actually do a clean uninstallation. So I had to clean up everything manually to do a fresh install successfully. &lt;/p&gt;&lt;p&gt;I greatly appreciate those who are competing to submit their bugs to win a prize in &lt;a href="https://connect.microsoft.com/SQLServer/content/content.aspx?ContentID=7734"&gt;Bug bash contest&lt;/a&gt; . You may watch some comments provided by Microsoft for the feedback (bugs and suggestions) I submitted about the installation failure below. &lt;/p&gt;&lt;p&gt;1 ) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334230"&gt;Katmai CTP-6 Refresh Build: Reporting Services and Database Engine Services and Reporting Services Fresh Installation failure&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Further let me take you through some of the bugs in Katmai CTP-6. &lt;/p&gt;&lt;p&gt;My friend &lt;a href="http://pedrocgd.blogspot.com/"&gt;Pedro&lt;/a&gt; has recently identified &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=333940"&gt;a bug about warning that is missing in SSIS 2008&lt;/a&gt; which was prevalent in SSIS 2005&lt;/p&gt;&lt;p&gt;The next part of the story is about pretty open blocking issues in SSAS and SSRS 2008 when I started working with reporting Services Project, you may look at them here:&lt;/p&gt;&lt;p&gt;2) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=335062"&gt;Katmai CTP 6: Analysis Services 2008 Migration Wizard cannot recognise Analysis Services 2005 Default Instance as a Source&lt;/a&gt;&lt;/p&gt;&lt;p&gt;3) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334109"&gt;Katmai CTP-6: SSRS 2008 MDX Query Builder issue while choosing (Critical) .NET Framework for Analysis Services as a Datasource&lt;/a&gt;&lt;/p&gt;&lt;p&gt;4) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=333383"&gt;Katmai CTP-6: Reporting services Project crashes in BIDS often unexpectedly and recovery does not reflect changes done during the last 5th min&lt;/a&gt;&lt;/p&gt;&lt;p&gt;5) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334112"&gt;Katami CTP-6: SSRS 2008 Datasource Wizard pops up T-SQL Query editor in place of MDX Query Builder after choosing OLEDB 9.0/10.0 Provider&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I also added a couple of suggestions for improvements in SSRS 2008 (6th one is very much an essential need from developer's perspective). You may look at them here: &lt;/p&gt;&lt;p&gt;6) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334135"&gt;Katmai : Require list of MDX Query Designer / Builder and MDX Query Editor Improvements&lt;/a&gt;&lt;/p&gt;&lt;p&gt;7) &lt;a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334458"&gt;Katmai: Require Dundas Maps and Calendar for the RTM or commercial release. &lt;/a&gt;&lt;/p&gt;&lt;p&gt;One thing to note here - "I'd rather expect not to hurry in releasing a product, boasting about it's features before ensuring that things are in place and they perfectly work as the way I boasted earlier.. Well Positively, I believe the reason behind Bug bash that helps me understand more..Gr8.. "&lt;/p&gt;&lt;p&gt;Guys, wishing you all the best for the contest and BTW be open about your opinions to comment them out here and take a few minutes to rate my feedback submissions, if you think they are important from your perspective. &lt;/p&gt;&lt;p&gt;Keep looking at this post for new bugs and suggestions submitted by me.&lt;/p&gt;&lt;p&gt;Thanks, Subhash Subramanyam&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-244899044113159240?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2008/03/some-sql-server-2008-february-ctp-6.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>14</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-126056482996310159</guid><pubDate>Fri, 21 Mar 2008 07:50:00 +0000</pubDate><atom:updated>2008-03-22T23:38:53.435-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><title>An approach to Load fact and Dimension tables</title><description>&lt;span style="font-family:georgia;"&gt;Friends,&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;Today I got into mood of testing &lt;/span&gt;&lt;a href="http://blogs.conchango.com/jamiethomson/archive/2005/10/21/2289.aspx"&gt;&lt;span style="font-family:georgia;"&gt;Jamie Thomson's way of loading a fact table using sort and merge join &lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:georgia;"&gt;as we see tenfold improvement in performance as opposed to the use of both I/O &amp;amp; memory intensive Look up in SSIS 2005 [You will soon run out of memory or experience unexpected delays while using look ups on bulk dimension on a system with low configuration (2GB, Intel P-IV X86)] . You can see how monthly Ticket Transactions, the excel sheet archive is loaded into Ticket Fact table using sort and inner join on each of the Dimensions as shown below:&lt;/span&gt;&lt;/p&gt;&lt;a href="http://picasaweb.google.com/subhashsubramanyam/BLOGPOST230308/photo#5180818657281882002"&gt;&lt;img src="http://lh4.google.com/subhashsubramanyam/R-X3HqEAt5I/AAAAAAAAAFc/J9KYy81H0fw/s800/FactTicket.PNG.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For Incremental load of Type 1 Dimensions from the same excel archive before loading fact tables, &lt;a href="http://sqlblog.com/blogs/andy_leonard/archive/2007/07/09/ssis-design-pattern-incremental-loads.aspx"&gt;Andy Leonards method &lt;/a&gt;really helps. The same Ticket Transactions Worksheet contain dimensional data which might be updates or new records. shown below is a typical incremental load of Dimension (Here an alternative method I suggest is to multicast the same source to parallel load Dimension as well as Fact table from the same worksheet). what you see below is incremental loading of two dimensions using look ups on the target Dimension sourced from the same worksheet.&lt;/p&gt;&lt;p&gt;&lt;a href="http://picasaweb.google.com/subhashsubramanyam/BLOGPOST230308/photo#5180818648691947394"&gt;&lt;img src="http://lh6.google.com/subhashsubramanyam/R-X3HKEAt4I/AAAAAAAAAFU/9hKckVmV-xk/s800/DimensionLoad.PNG.jpg" /&gt;&lt;/a&gt; &lt;p&gt;&lt;p&gt;In my forthcoming posts, I'd like to cover in brief about the pratical approach taken to test all the new features availed at the end of Feb CTP- 6 SSIS 2008 . Another important post that I wish to include is the SSIS Future Version Wishlist. &lt;/p&gt;&lt;p&gt;Hope everyone is enjoying good friday. &lt;/p&gt;&lt;p&gt;Cheers, Subhash Subramanyam&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-126056482996310159?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2008/03/approach-to-load-fact-and-dimension.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-7185808927149297298</guid><pubDate>Sun, 30 Dec 2007 06:57:00 +0000</pubDate><atom:updated>2011-09-21T05:17:28.811-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle</category><title>Useful Oracle SQL  PL/SQL Code Snippets for my Reference</title><description>A sample PL / SQL that has 2 Input Paremeters  and 2 output parameters that intake and return the values.&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE PROCEDURE SP_WEEKDAYS(START_DT IN DATE, END_DT IN DATE, CALENDARID IN CHAR, TOTALDAYS OUT NUMBER, WORKINGDAYS OUT NUMBER)&lt;br /&gt;IS                                                                              &lt;br /&gt;BEGIN&lt;br /&gt;SELECT COUNT(WORKDAY_FLG)INTO TOTALDAYS   FROM RIP_CAL_FACTORY_CALENDAR&lt;br /&gt;WHERE CALENDAR_DATE BETWEEN START_DT AND END_DT  AND (CALENDAR_ID = CALENDARID) ;&lt;br /&gt;SELECT SUM(WORKDAY_FLG) INTO WORKINGDAYS  FROM RIP_CAL_FACTORY_CALENDAR&lt;br /&gt;WHERE CALENDAR_DATE BETWEEN START_DT AND END_DT  AND (CALENDAR_ID = CALENDARID) ;&lt;br /&gt;END ;&lt;br /&gt;&lt;br /&gt;The followng PL/SQL displays the values returned by the above code:&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt;RET_TOTALDAYS NUMBER;&lt;br /&gt;RET_WORKINGDAYS NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;SP_WEEKDAYS('06-JUN-08','05-DEC-08', 'H9', RET_TOTALDAYS, RET_WORKINGDAYS);&lt;br /&gt;Dbms_Output.Put_line('Working Days = ' || RET_WORKINGDAYS || '  Total_days = ' ||   RET_TOTALDAYS )  ;&lt;br /&gt;END ;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-7185808927149297298?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/12/useful-oracle-sql-plsql-code-snippets.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-3142625082418507921</guid><pubDate>Wed, 26 Dec 2007 07:08:00 +0000</pubDate><atom:updated>2011-09-21T07:18:21.330-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Useful T-Sql Snippets for my Reference</title><description>Get the list of all Primary Keys and associated foreign keys:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;select a.name,c.name as pk_table ,b.name fk_table &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;from sys.foreign_keys a&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;inner join sys.sysobjects b on b.id = a.parent_object_id&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;inner join sys.sysobjects c on c.id = a.referenced_object_id&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;Richard Campbell's session on &lt;a href="http://www.campbellassociates.ca/blog/PermaLink.aspx?guid=823bdca5-ec17-4689-ac0c-e653664164bf"&gt;Error Handling using Sql Server 2005's Try Catch&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;RETRY:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;BEGIN TRY&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  BEGIN TRANSACTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  UPDATE tblContact SET LastName = 'SP_LastName_1' WHERE ContactID = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  UPDATE tblContact SET LastName = 'SP_LastName_2' WHERE ContactID = 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  COMMIT TRANSACTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;END TRY&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;BEGIN CATCH&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  SET @Err = @@ERROR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  IF @Err = 1205&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    ROLLBACK TRANSACTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    INSERT INTO ErrorLog (ErrID, ErrMsg) VALUES (@Err, 'Deadlock recovery attempt.')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    WAITFOR DELAY '00:00:10'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    GOTO RETRY&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  IF @Err = 2627&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    SET @ErrMsg = 'PK Violation.'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  IF @ErrMsg IS NULL&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    SET @ErrMsg = 'Other Error.'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  INSERT INTO ErrorLog (ErrID, ErrMsg) VALUES (@Err, @ErrMsg)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;END CATCH&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you carefully notice, Catch exception above handles the logic based on the type of error captured.&lt;span style="color: rgb(0, 0, 224);font-family:Courier New;font-size:78%;"  &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-3142625082418507921?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/12/useful-t-sql-snippets-for-my-reference.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-4177794409485941902</guid><pubDate>Tue, 18 Dec 2007 02:49:00 +0000</pubDate><atom:updated>2008-01-02T19:41:55.923-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><title>Conversion of  BRIO to SSIS Made Easy</title><description>Prerequisite is that we must know how each BRIO query work and some knowledge of Practical implementation of things in SSIS. A BRIO query may be composed of a set of dependant or independant queries.&lt;br /&gt;&lt;br /&gt;Let's summarize essential steps for migration:&lt;br /&gt;&lt;br /&gt;1) Each BRIO query may consist of list of queries and each of those results may have dependencies for further stages. Study how they actually work.&lt;br /&gt;a) What are the Sources used&lt;br /&gt;b) How many are the Results output&lt;br /&gt;c) How many are computed columns&lt;br /&gt;d) what are the limits for the rows&lt;br /&gt;e) On what basis to sort the rows&lt;br /&gt;d) Whether they have joins ? If yes what type of join and  so on.&lt;br /&gt;&lt;br /&gt;2) Create all connections required for querying using Connection Managers in SSIS:&lt;br /&gt;a) Make sure to use appropriate drivers. For instance, IBM Red Brick Driver is essentially an ODBC driver. Sql Server can use Native Client, If we use Oracle connection on 64 bit Box, MSDAORA works with RunTime64bit Property set to false. If we use ORACLE 64-bit Driver for OLEDB, then we must cast those columns in the query mentioning appropriate precisions of defined type.&lt;br /&gt;&lt;br /&gt;3) Dealing with BRIO Computed Columns by using matching functionalities in SSIS or SSIS transformations on the fly:&lt;br /&gt;&lt;br /&gt;a) Replacing BRIO functions - "Prior" , "Next", "Cume" and other cumulative functions to SSIS equivalent functionality (Note: Require extra attention)&lt;br /&gt;Beware of these functions as they require traversing between prev and next rows or require row wise manipulation. Some of my colleagues were more comfortable using cursors after they found no better way of tracking previous or next rows for manipulation of the outgoing rows, as the usage of SSIS design time variables degrade performance.  However we should keep in mind that we can arrive at the right output choosing the best among different ways (You might think I'm very conservative..).  Well in our case we tracked that  "Next" function was used to remove duplicates in a Column after sorting, for which luckily we had Sort transformation with delete duplicate option selected in SSIS. But in the other case we used Cume, Brio syntax: Computed_Col_C = Cume(A,B), Where A is by default 1. and B increments the cumulative value of A based on the repitition of Key column. Cursor was a bruteforce method to be used here since even newly available functionality like "CTEs using ROW_NUMBER OVER (ORDER BY ID)"  was unable replace the equivalent functionality.&lt;br /&gt;However its always better to avoid cursors (impact of study of Inside Sql Server 2005 Programming, Microsoft Press by Grant Fritchey) wherever applicable as they are I/O intensive and main cause for performance degrade as I've dicussed about this already while speaking about dealing with tempdb issues.&lt;br /&gt;&lt;br /&gt;b) Solution for BRIO If Else, Nested If Else, Nvl and Nested Nvls computed Columns using Derived Column transformation in SSIS.&lt;br /&gt;&lt;br /&gt;NVL Equivaent script in SSIS Derived Transform:&lt;br /&gt;ISNULL(ColA)? (ISNULL(ColB)?ColC:ColB):ColA&lt;br /&gt;&lt;br /&gt;A Nested if else equivalent in SSIS Script Component Transform, will be very much straight foward.&lt;br /&gt;&lt;br /&gt;4) Limits in BRIO can be replaced by Conditional Split Transform, where the output row can be named based on the filtering condition and can be routed to further transformations or to Destination.&lt;br /&gt;&lt;br /&gt;5) BRIO joins using source tables  coming from different sources in SSIS involves using Sort transform for every query extract based on a key column and then use merge join selecting the nature of join appropriately.  Note that while sorting you may be interest in removing duplicate key columns if appropriate.&lt;br /&gt;&lt;br /&gt;6)  Lookup or SCD transformations can be applied in some cases where we need to keep track of  the changes in records or in case we require to track or re-direct the duplicate rows for further processing.&lt;br /&gt;&lt;br /&gt;7) You can parallelize loads in situations where BRIO extracts data from different sources that are to be merged  into a single dimension table. Do all the transformations necessary for each of the source query, finally adding the Merge Transformation that simply merge the results which you can further Process or send it to the destination.&lt;br /&gt;&lt;br /&gt;Refer Screenshots of few SSIS Packages that are results of BRIO query conversion:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TtJTxWjMKjU/R2kvGZItq2I/AAAAAAAAABc/KjgyypYXQhU/s1600-h/2.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_TtJTxWjMKjU/R2kvGZItq2I/AAAAAAAAABc/KjgyypYXQhU/s400/2.PNG" alt="" id="BLOGGER_PHOTO_ID_5145695836120656738" border="0" /&gt;&lt;/a&gt;Figure1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TtJTxWjMKjU/R2kwMJItq4I/AAAAAAAAABs/aXVzoS_hu3U/s1600-h/SSIS_Dataflow_after_BRIO_Conversion.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_TtJTxWjMKjU/R2kwMJItq4I/AAAAAAAAABs/aXVzoS_hu3U/s400/SSIS_Dataflow_after_BRIO_Conversion.PNG" alt="" id="BLOGGER_PHOTO_ID_5145697034416532354" border="0" /&gt;&lt;/a&gt;Figure 2&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Fig 1 and 2,  Showing how we can convert BRIO Logic to extract from different sources, clean, massage, sort, merge and join to load finally into a dimension.&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-4177794409485941902?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/12/conversion-of-brio-queries-to-ssis-made.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_TtJTxWjMKjU/R2kvGZItq2I/AAAAAAAAABc/KjgyypYXQhU/s72-c/2.PNG" height="72" width="72" /><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-8961997637325000798</guid><pubDate>Fri, 16 Nov 2007 14:44:00 +0000</pubDate><atom:updated>2007-12-09T20:08:18.464-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Get the Row Counts for all tables in Database in Sql Server 2005</title><description>One way of doing the above is using &lt;a href="http://blogs.msdn.com/mandar/archive/2006/06/26/647128.aspx"&gt;sys.partitions&lt;/a&gt; according to mandar in which the T-SQL can be further cleaned up to eliminate all the System tables and views as given below:&lt;br /&gt;&lt;br /&gt;DBCC UPDATEUSAGE(AdventureWorksDW)&lt;br /&gt;&lt;br /&gt;SELECT OBJECT_NAME(object_id) TableName,&lt;br /&gt;SUM(Rows) NoOfRows --total up if there is a partition&lt;br /&gt;FROM sys.partitions&lt;br /&gt;WHERE index_id &lt;&gt;) --Restrict the Table Names&lt;br /&gt;GROUP BY object_id&lt;br /&gt;&lt;br /&gt;but the problem with the above Sql Statment is that the statistics does not get updated unless we use DCC Updateuage.&lt;br /&gt;&lt;br /&gt;Credit goes to Dipendra Baghel, Gidwani Sunil and Prashant tiwari today who were able to write a simple T-SQL using CURSOR ( pasted below) that can take count of rows for all tables and export to a table in a database . Astonishing that atlast I found the same code already written by &lt;a href="http://madhuottapalam.blogspot.com/2006_12_01_archive.html"&gt;Madhu K Nair&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Drop table #TEMP&lt;br /&gt;&lt;br /&gt;DECLARE @TableName nvarchar(255)&lt;br /&gt;DECLARE @sqlStatement nvarchar(255)&lt;br /&gt;DECLARE @tblRowCount int&lt;br /&gt;CREATE TABLE #temp (table_name sysname,row_count int)&lt;br /&gt;&lt;br /&gt;DECLARE @tableNameCursor CURSOR&lt;br /&gt;SET @tableNameCursor = CURSOR FOR SELECT name from sys.tables&lt;br /&gt;OPEN @tableNameCursor&lt;br /&gt;FETCH NEXT FROM @tableNameCursor INTO @TableName&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt;FETCH NEXT FROM @tableNameCursor INTO @TableName&lt;br /&gt;select @sqlstatement= 'Select ''' + @TableName + ''', Count(*) from '+ @TableName&lt;br /&gt;select @sqlStatement= 'Insert into #temp '+ @sqlstatement&lt;br /&gt;exec(@sqlStatement)&lt;br /&gt;END&lt;br /&gt;CLOSE @tableNameCursor&lt;br /&gt;DEALLOCATE @tableNameCursor&lt;br /&gt;&lt;br /&gt;--Check to see the records&lt;br /&gt;SELECT * FROM #TEMP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using a stored procedure called sp_spaceused&lt;databasename&gt; can get you more details along with count of rows as well space used for the table:&lt;br /&gt;&lt;br /&gt;Drop table #TEMP&lt;br /&gt;&lt;br /&gt;DECLARE @TableName nvarchar(255)&lt;br /&gt;DECLARE @sqlStatement nvarchar(255)&lt;br /&gt;DECLARE @tblRowCount int&lt;br /&gt;CREATE TABLE #temp (table_name sysname,row_count int)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DECLARE @tableNameCursor CURSOR&lt;br /&gt;SET @tableNameCursor = CURSOR FOR SELECT name from sys.tables&lt;br /&gt;OPEN @tableNameCursor&lt;br /&gt;FETCH NEXT FROM @tableNameCursor INTO @TableName&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt;FETCH NEXT FROM @tableNameCursor INTO @TableName&lt;br /&gt;select @sqlstatement= 'sp_spaceused '+ '"'+ @TableName +'"'&lt;br /&gt;exec(@sqlStatement)&lt;br /&gt;END&lt;br /&gt;CLOSE @tableNameCursor&lt;br /&gt;DEALLOCATE @tableNameCursor&lt;br /&gt;&lt;br /&gt;SELECT * FROM #TEMP&lt;/databasename&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-8961997637325000798?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/11/get-row-counts-for-all-tables-in.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-8048120054414184537</guid><pubDate>Thu, 15 Nov 2007 04:54:00 +0000</pubDate><atom:updated>2007-12-17T01:16:46.142-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sql Server 2005</category><title>Solutions to space and performance related issues associated with tempdb in Sql  Server 2005</title><description>Last week I was given a bunch of stored procedures and informed to modify in such a way that it should not cause TEMPDB space errors in the future (one of the usual error is - "The transaction log for database 'PRO_DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases".)&lt;br /&gt;&lt;br /&gt;Prior to this, the task had been assigned to my Colleague Deepesh Pathak contributed to adding Begin Transaction and commit transaction for every batch update statement which they found it to resolve nearly 5-10% of the issue. Print messages added with time record for every T-SQL statement, gave clear hints that there were couple of long running transactions. Particulary some transactions nearly took 14 hours to complete and main traps were the index build statements.&lt;br /&gt;&lt;br /&gt;So to troubleshoot the issue, I read about &lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx"&gt;"Working with tempdb in Sql Server 2005"&lt;/a&gt; a very useful article written by Wei Xiao, Matt Hink, Mirek and Sunil Agarwal . Compiling this article with the extract of other articles like &lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx"&gt;Troubleshotting Performance Problems&lt;/a&gt; and &lt;a href="http://sqlserver-qa.net/blogs/perftune/archive/2007/08/14/1415.aspx"&gt;Sql Server Security, Performance &amp;amp; Tuning&lt;/a&gt; , I was able to implement a solution that not only resolved the tempdb issues but also improved performance remarkably. Following are usual steps involved:&lt;br /&gt;&lt;br /&gt;1) Read about the Tempdb objects and when, why and how they are used. Best idea will be to create a test environment.&lt;br /&gt;&lt;br /&gt;2) Performance Counters to get tempdb usage statistics(Database Log file(s) Size KB, Log File(s) Used, Free Space in Tempdb,Version store size (KB), Version generation rate (KB), Version Clean rate(KB)) .&lt;br /&gt;&lt;br /&gt;3) Using the rich set of DMVs (Dynamic Management Views) provided by Sql Server 2005 : &lt;span style="FONT-WEIGHT: bold"&gt;sys.dm_db_file_space_usage&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;sys.dm_db_session_file_usage&lt;/span&gt; and &lt;span style="FONT-WEIGHT: bold"&gt;Sys.dm_db_task_space_usage&lt;/span&gt; helps to further investigate.&lt;br /&gt;eg:&lt;br /&gt;The following query shows the top five sessions that have allocated a maximum space for user objects and internal objects in &lt;b&gt;tempdb&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;pre class="codeSample"&gt;SELECT top 5 *&lt;br /&gt;FROM sys.dm_db_session_space_usage&lt;br /&gt;ORDER BY (user_objects_alloc_page_count +&lt;br /&gt;internal_objects_alloc_page_count) DESC&lt;/pre&gt;The following query shows the top five tasks that are currently executing tasks and consuming the most tempdb space&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="codeSample"&gt;SELECT top 5 *&lt;br /&gt;FROM sys.dm_db_task_space_usage&lt;br /&gt;ORDER BY (user_objects_alloc_page_count +&lt;br /&gt;internal_objects_alloc_page_count) DESC&lt;/pre&gt;&lt;br /&gt;4) Version Store: If the version store is not shrinking, it is likely that long running queries is preventing version store clean up. You can query the sys.dm_db_task_space_usage DMV to find out which tasks are consuming the most space in tempdb. and can kill them if appropriate.&lt;br /&gt;&lt;br /&gt;&lt;pre class="codeSample"&gt;SELECT top 5 transaction_id, transaction_sequence_num,&lt;br /&gt;elapsed_time_seconds&lt;br /&gt;FROM sys.dm_tran_active_snapshot_database_transactions&lt;br /&gt;ORDER BY elapsed_time_seconds DESC&lt;/pre&gt;&lt;br /&gt;5) Tempdb can only be configured in the Simple recovery model. An active long running query can use up all the space preventing the transaction log clean up. sys.dm_tran_active_transactions DMV can be used to find the longest running transactions and can kill the appropriate ones.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Off Tempdb issue, Bit an essential performance tip&lt;/strong&gt;&lt;br /&gt;7) Tuning the I/O intensive queries (Cursor based) require:&lt;br /&gt;a) Usage of related Performance counters for learning about the Current state of I/O.&lt;br /&gt;b) Monitoring contentions caused by DML and DDL operations by using DMVs such as &lt;span style="FONT-WEIGHT: bold"&gt;sys.dm_exec_query_stats&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;sys.dm_exec_sql_text&lt;/span&gt; and &lt;span style="FONT-WEIGHT: bold"&gt;sys.dm_exec_query_plan&lt;/span&gt;. Eg: Mixing set-based queries wherever cursors can be replaced for a better performance. This will speed up by taking advantage of the best query plan eventually.&lt;br /&gt;c) Use of task Manager to monitor the resource usage.&lt;br /&gt;d) Making sure that we have Minimal I/O bandwidth (replace with a better configuration)&lt;br /&gt;&lt;br /&gt;8) Tempdb settings:&lt;br /&gt;a) Enabling Auto grow setting leads to fragmentation usually when the growth exceeds the allocated space. This can be applied as a last resort when there are many unplanned exceptions.&lt;br /&gt;b) Avoid shrinking files as there are limitations tied up with this.&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-8048120054414184537?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/11/dealing-with-tempdb-space-issues.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-7482366477332538044</guid><pubDate>Thu, 15 Nov 2007 03:55:00 +0000</pubDate><atom:updated>2007-11-16T19:57:55.644-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><title>One of the best approach to load data into Oracle data mart using SSIS</title><description>I tried all the drivers MSDAORA, ORAOLEDB and .NET Providers to load from Sql Server to Oracle, but the load time didn't differ. Performance aggravated as we did not have any control of increasing the commit size on Oracle . I understood from Scott Barrett's and Sutha Thiru's blog  that using &lt;a href="http://www.persistentsys.com/products/ssisoracleconn/ssisoracleconn.htm"&gt;Persistent's SSIS Oracle bulk Load connector&lt;/a&gt; gave an outstanding performance. But again the Client Organization standard didn't allow buying a third party tool for the sake of this.&lt;br /&gt;&lt;br /&gt;So finally, I read about &lt;a href="http://www.orafaq.com/faqloadr.htm"&gt;SQL* Loader&lt;/a&gt; and Eureka ...! how about dumping the required Sql Server Data into Flatfiles and then bulk import these files to Oracle using SQL* Loader. As the SQL* Loader has better options to load full or incremental data with a robust performance, it did a miracle..Nearly 80% of the time was saved. I used a Flat File Source Option to overwrite the file for every SQL Server Export in the SSIS and then Import to Sql Loader by running a batch file via Execute Process Task which calls a control file that has a SQL to Bulk Import this flatfile. (You may want to create a branch here for Incremental and Full Load with a precedence expression that validates a boolean variable. This boolean variable can be used in Package Configurations to preset the value whether you want Incremental or Full load).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Th batch file(Full_Load.bat) script is as below:&lt;br /&gt;&lt;br /&gt;sqlldr userid=user_ro/user_ro00@ora_datamart control="F:\APPLICATION_JOBS\MY_ASSET\SQL_LOADER_JOBS\FULL_LOAD.ctl" log="F:\APPLICATION_LOGS\MY_ASSET\FULL_LOAD.txt"&lt;br /&gt;&lt;br /&gt;/** sqlldr - sql loader utility in the Oracle bin folder. Make sure this is added into PATH (Environmental variable) **/&lt;br /&gt;&lt;br /&gt;The Control File (Full_Load.ctl) looks like the one below:&lt;br /&gt;LOAD DATA&lt;br /&gt;INFILE 'F:\APPLICATION_DEPENDENTFILES\MY_ASSET\TABLEEXPORTS\DUMP_FILE.txt'&lt;br /&gt;BADFILE 'F:\APPLICATION_DEPENDENTFILES\MY_ASSET\TABLEEXPORTS\BADFILE.txt'&lt;br /&gt;REPLACE&lt;br /&gt;INTO TABLE SCHEMA.LOAD_TABLE&lt;br /&gt;FIELDS TERMINATED BY ','&lt;br /&gt;TRAILING NULLCOLS&lt;br /&gt;(&lt;br /&gt;COL1,&lt;br /&gt;COL2,&lt;br /&gt;COL3 DATE(19) "YYYY-MM-DD HH24:MI:SS"&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Note: * COL3 is casted to  Date on the fly with a precison and format mentioned.&lt;br /&gt;* Specifying a Bad file assist in tracking inconsistent rows.&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-7482366477332538044?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/11/one-of-best-approach-to-load-data-into.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-7744522978079304610</guid><pubDate>Wed, 24 Oct 2007 07:50:00 +0000</pubDate><atom:updated>2007-11-14T20:42:18.867-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Extract Last 12 months data if you have a Month_Code Column of the format  'YYYYMM'</title><description>SELECT * FROM REPORT_DATA&lt;br /&gt;WHERE (MONTH_CODE &gt;=&lt;br /&gt;Replace(LEFT(CONVERT([varchar],dateadd(month,-1,getdate()) , 120), 7),'-','') )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks to Dipendra Baghel who assited  in framing this.&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-7744522978079304610?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/10/extract-last-12-months-data-if-you-have.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-7562667132847447069</guid><pubDate>Tue, 23 Oct 2007 04:08:00 +0000</pubDate><atom:updated>2007-10-22T22:05:42.282-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSAS</category><title>Synchronizing all Instances for NLB using ascmd Script</title><description>Thanks to Lin Li for her support on NLB.&lt;br /&gt;1. Download the ascmd Project (used to &lt;span style=""&gt;&lt;/span&gt;trigger MDX, XMLA or DMX from batch windows).&lt;br /&gt;2. Compile and run the Project (This creates an exe file called ascmd.exe) . This may require decryption&lt;br /&gt;3. Generate XMLA  files that Synchronize one instance with rest of all and store this into a file with xmla extension, say SyncInstance02.xmla, SyncInstance03.xmla and so on.&lt;br /&gt;&lt;br /&gt;4. Create a batch file, say Sync.cmd, containing script that use ascmd file to execute XMLA:&lt;br /&gt;&lt;br /&gt;ascmd -S &lt;ssasinstance02&gt; -i "&lt;/ssasinstance02&gt;SyncInstance02&lt;ssasinstance02&gt;.xmla"&lt;br /&gt;asmcd -S &lt;ssasinstance03&gt; -i "&lt;/ssasinstance03&gt;&lt;/ssasinstance02&gt;SyncInstance03&lt;ssasinstance02&gt;&lt;ssasinstance03&gt;.xmla"&lt;br /&gt;.... -S &lt;ssasintance0n&gt; i "SyncInstance0n.xmla"&lt;br /&gt;&lt;br /&gt;5. Place all the Script and executable files into a folder (.cmd, .xmla, ascmd.exe) into a folder.&lt;br /&gt;&lt;br /&gt;6. To Automate the Process:&lt;br /&gt;Use SSASInstance01 for Processing, and the rest of the instance should be synced for all kinds of refreshes done on Instance01. You may add an Execute process task to execute the cmd script after Incrementally or Fully processing SSASInstance01 Objects.&lt;/ssasintance0n&gt;&lt;/ssasinstance03&gt;&lt;/ssasinstance02&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-7562667132847447069?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/10/synchronizing-all-instances-for-nlb.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-5309479405263058768</guid><pubDate>Mon, 15 Oct 2007 13:15:00 +0000</pubDate><atom:updated>2007-11-14T20:40:48.469-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><title>Way to Install Sql Server Integration Services (IS) and Notification Services (NS) on Fail Over Cluster Environment</title><description>&lt;span xmlns=""&gt;&lt;p&gt;I'd like to brief the steps for IS and NS Set up on Clusters:&lt;br /&gt;&lt;/p&gt;&lt;ol style="margin-left: 54pt;"&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/biztalk/2006/library/bts06clustering/55b0c81f-44a5-4069-b065-57df1cce19ac.mspx?mfr=true"&gt;Add MSDTC as a Clustered Service&lt;/a&gt; before starting the IS and NS Installation.  &lt;a href="http://support.microsoft.com/kb/301600"&gt;Distributed Transaction Coordinator service&lt;/a&gt; should be running on both the nodes.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms345193.aspx"&gt;Deploy the  SSIS and NS installation&lt;/a&gt; separately on both the nodes. One must be in active mode and the other in Passive mode while installing.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Apply &lt;a href="https://swmedia.cv.hp.com/Vendors/Microsoft/NowShowing.asp"&gt;Service Pack 2A&lt;/a&gt; and &lt;a href="http://support.microsoft.com/kb/935356"&gt;Cumulative Hot fix Latest build&lt;/a&gt; (Recommended for boxes running analysis Services also, Prevents memory leakage, Avoids Cache memory issues)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add &lt;a href="http://sqljunkies.com/WebLog/knight_reign/archive/2005/07/06/16015.aspx"&gt;IS as a Clustered Service&lt;/a&gt;&lt;br /&gt;    &lt;/li&gt;&lt;li&gt;Add &lt;a href="http://msdn2.microsoft.com/en-us/library/ms171407.aspx"&gt;NS as a Clustered Service&lt;/a&gt;&lt;br /&gt;    &lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-5309479405263058768?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/10/way-to-install-sql-server-integration_15.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-1710121866300999136</guid><pubDate>Sat, 13 Oct 2007 03:58:00 +0000</pubDate><atom:updated>2007-11-14T20:40:22.547-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSIS</category><title>How to Send a Mail to a Personal Distribution List ?</title><description>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Sending a PDL reuires a special email address created by the exchange server to multicast mails to array of Email IDS,&lt;br /&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1922591&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1922591&amp;amp;SiteID=1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="poweredbyperformancing"&gt;Powered by &lt;a href="http://scribefire.com/"&gt;ScribeFire&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-1710121866300999136?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/10/how-to-send-mail-to-personal.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-5165086472427134675</guid><pubDate>Tue, 18 Sep 2007 11:25:00 +0000</pubDate><atom:updated>2007-11-14T20:39:50.901-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSAS</category><title>Way to know Sql Server or Analysis Server 2005 Version, SPs and Edition installed</title><description>&lt;blockquote&gt;&lt;p&gt;Sunil (my Lead) asked me about this. When I googled, I found it &lt;a href="http://sqlserver2000.databases.aspfaq.com/how-do-i-know-which-version-of-sql-server-i-m-running.html"&gt;here&lt;/a&gt;. But our problem was that we had only Analysis Services and Integration Services running on our machine. Finally I found that in MSDN forums, that by looking at the version number displayed along with the Server Instance it is also possible to the SP installed on the machine:&lt;/p&gt;&lt;p&gt;- 9.00.1399 for RTM&lt;br /&gt;- 9.00.2047 for SP1&lt;br /&gt;- 9.00.3042 for SP2 and so on.&lt;/p&gt;&lt;p&gt;There are 2 ways to know the Edition of Analysis Server :&lt;br /&gt;&lt;/p&gt;&lt;p&gt; 1)  Run Regedit, Open the Path: %HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Microsoft  SQL Server\MSSQL 2.0\Setup.  You will see the Edition Details on the right Pane&lt;/p&gt;&lt;p&gt;2) On SSMS, Connect to Analysis Server, Right Click on the SSAS Server, Report-&gt; Standard Reports -&gt; General&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-5165086472427134675?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/09/way-to-know-sql-server-or-analysis.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-2862461919690497588</guid><pubDate>Mon, 10 Sep 2007 06:13:00 +0000</pubDate><atom:updated>2008-01-28T04:42:56.143-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SSAS</category><title>Resolutions for common Issues and Facts while using SSAS 2005</title><description>&lt;span xmlns=""&gt;&lt;p&gt;In general these are some common that we must be aware of while working on SSAS else we end up wasting our precious time googling and reading articles in detail.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Locking mechanisms are inherent in Sql server 2005 (OLAPLockTypes). Hence this feature is deprecated.&lt;br /&gt;* By default if a user is trying to update or process the objects in SSAS 2005. Other user will not be able to access that object until it becomes free.&lt;br /&gt;* Explicit Rollback and Commit transactions provided by the server can help in granting both of the users or neither of them in updating or reading the cube simultaneously&lt;br /&gt;* Query Log table availed in the Sql Server 2000 Analysis Server repository by default was helpful to determine the OLAP usage statistics. &lt;/li&gt;&lt;li&gt;Sql Server 2005 allows this option via its properties where you should manually set a data source where you want to create query log table will be created.&lt;br /&gt;* Structure of this table is fixed and you cannot alter them.&lt;br /&gt;* Binary values are stored in DataSet Column&lt;br /&gt;* You can run trace files at the background initiated by Sql Profiler that helps to store recent information about the query run. However if you want to log every single query or activity then it’s better to set up a trace using.&lt;br /&gt;* How to leverage the Querylog Table? Usage based optimization wizard is meant for this. Required details like begin and end dates are prompted, set to choose: Performance gain of 30%. &lt;/li&gt;&lt;li&gt;Purpose of doing count estimates while partitioning the cube helps in adjusting the performance of the query as well as determining if the limitation has reached (Not more than 20 million rows). Key to choice of storage settings( MOLAP or ROLAP) is here:&lt;br /&gt;* Set the Performance based on frequency of use. eg set 45% Performance with MOLAP on Partition 200708, set 30% Performance with MOLAP on Partition 200707 and so on.&lt;br /&gt;* For rarely queried partitions, use ROLAP with slice value setting.&lt;br /&gt;* Do apply Proactive caching for frequently accessed MOLAP Partitions- An enhancement feature. &lt;/li&gt;&lt;li&gt;While Processing Dimensions, beware of those which exceed 4 GB since an exception is thrown. Finally Sunil has found a workaround that a property for a dimension should be manually set to attributes rather than tables. Take a look at &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1629338&amp;amp;SiteID=1"&gt;this link &lt;/a&gt;for settings required to increase the size of string store. Usually a common error that occur here is "File system error: A File Store error from Write File occurred.Physical file...". Solution is to change all the ProcessingGroup properties to ByAttribute &lt;/li&gt;&lt;li&gt;AMO can be used in ASP.NET by making sure that the Account Name you add in your Application pool has OLAP Admin privileges. Once done you can even delegate the privileges to users using AMO. You can Change the account in Identity tab of your selected Application Pool's Properties of inetmgr. &lt;/li&gt;&lt;li&gt;Clearing Analysis services 2000 Process logs (mdb files or tempdb, incase if you have migrated the repository, Prashant is much aware of this issue)&lt;br /&gt;* Few possible methods mentioned in Microsoft web link:&lt;br /&gt;* Right Click Analysis Services Properties , Logging - &gt;clear the log - &gt; Specify drive having enough space. Dbcc shrinkdatabase tempdb or dbcc shrinkfile(&lt;filename&gt;,’space in MB’).&lt;br /&gt;* Alter database tempdb... command to specify the least size. Stop and restart the analysis service.&lt;br /&gt;* But in fact the second step considerably increased my tempdb space. &lt;/filename&gt;&lt;/li&gt;&lt;li&gt;Have you come across an error which is very common: "Class Not Registered", when you click browse cube. Solution is to install the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7287252c-402e-4f72-97a5-e0fd290d4b76&amp;amp;DisplayLang=en"&gt;OWC – Office Web Components&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Validation of Data by browsing dimensions and cubes consists of the following Steps:&lt;br /&gt;* Check if all the levels show data after migration.&lt;br /&gt;* Browse the Cube, Check every dimension against the calculated members, and drill down to the lowest level and match this against legacy.&lt;br /&gt;* Note: Pivoting should also show the similarity in data up to lower levels. &lt;/li&gt;&lt;li&gt;The attribute hierarchy relations will get grouped down at the lowest level attribute (key attribute). In the above case, every attribute must be re-linked manually to its immediate parent attribute. &lt;/li&gt;&lt;li&gt;Recreating the dimensions are required incase of Attributes having Parent Child relationships&lt;/li&gt;&lt;li&gt;Have you come across an error: OLEDB or ODBC error, Login failed for user 'NT AUTHORITY\NetworkService'.;42000. This is because we are supposed to add/ create the above account for the Sql Server in which your data source reside. Do apply sysadmin privlege to it if you are using AS2000. You may want to &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=371493&amp;amp;SiteID=1"&gt;look at this link&lt;/a&gt; for detailed help. &lt;/li&gt;&lt;li&gt;You might get an error - "Server Option cancelled.. check the driver..." , Solution is to check if IIS, Network DTC, Network COM+ in Windows Installation Componenents - &gt; Application Server has been checked. and the respective Services are running in Services snap-in. &lt;/li&gt;&lt;li&gt;"Error in OLAP Storage Engine: Invalid Key Error", Solution is to Check for the Data Quality issues and While processing if you require to ignore these errors , then Change settings under Dimension key errors tab to ignore errors.&lt;/li&gt;&lt;li&gt;"Drill through failed. Error in the OLAP Engine .." . Solution : Under Analysis Services -&gt; Advanced Properties -&gt; Set Value of OLAP\Process\ROLAPProcessingEffort = count(Fact table ) + probable growth of rows. Provided the fact Dimensions have been added for the drill through with ROLAP Storage set. &lt;/li&gt;&lt;li&gt;"Connection timed out .."  Solution: Under Analysis Server -&gt; Advanced Properties -&gt; set Value of ConnectionTimeout= 0 and ExceedConnectionTimeout =0.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-2862461919690497588?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/09/resolutions-for-common-issues-and-facts.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4701270203513738041.post-6426178697817604514</guid><pubDate>Wed, 25 Jul 2007 13:27:00 +0000</pubDate><atom:updated>2011-09-21T07:17:56.392-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Data Type Casting and Conversions</category><category domain="http://www.blogger.com/atom/ns#">T-SQL Programming</category><title>Populating Oracle Timestamp values into Sql Server Datetime</title><description>This is not as easy as melting the ice. If we do not know how to CAST or convert, we may end up googling around for days.. My special thanks to &lt;a href="http://www.blogger.com/sunil.gidwani@hp.com"&gt;Gidwani, Sunil&lt;/a&gt; (Project Lead, KPIT) and Umachandar who literally &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1843532&amp;SiteID=1"&gt;answered this issue on MSDN forums&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;1) First of all we must know the valid ranges supported by &lt;a href="http://www.psoug.org/reference/timestamp.html"&gt;Oracle timestamp&lt;/a&gt; and &lt;a href="http://technet.microsoft.com/en-us/library/ms187752.aspx"&gt;Sql Server Datetime&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2) Understand that: "Migrating values from Oracle to SQL Server is a different ballgame. You will lose precision, values etc. Oracle has more richer support and wider ranges &amp;amp; ANSI SQL implementation. - Jayashankar,Umachandar "&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now Switch to one of these Solutions to cast to Sql Server Datetime:&lt;br /&gt;&lt;br /&gt;3) Try to work from oracle side by casting the timestamp columns to return the valid format and range required to populate Sql server Datetime Columns.&lt;br /&gt;&lt;br /&gt;"Using Oracle Sql, Use Extract function to extract year, Validate the year, Use Decode Function to subtitute suitable values for the cases as shown - Gidwani, Sunil"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;REQUESTED_ETA_DATE_CUST (Oracle timestamp)&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;Decode(trunc((Extract(YEAR from REQUESTED_ETA_DATE_CUST))/1753), 0,'01/01/1753 12:00:00 AM', TO_CHAR(REQUESTED_ETA_DATE_CUST, 'MM/DD/YYYY hh:mm:ss AM')) as REQUESTED_ETA_DATE_CUST&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) CAST the timestamp to string which is acceptable format for Sql Server Datetime, Do valid range filtering using SSIS transform.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;REQUESTED_ETA_DATE_CUST (Oracle timestamp)&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;TO_CHAR(REQUESTED_ETA_DATE_CUST, 'MM/DD/YYYY hh:mm:ss AM')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use an expression in derived Transform to filter out valid ranges for Sql Server Datetime as follows:&lt;br /&gt;&lt;br /&gt;SUBSTRING([REQUESTED_ETA_DATE_CUST], 6,10) &lt; 1753 ? (DT_DBTIMESTAMP)'01/01/1753 12:00 AM' : (DT_DBTIMESTAMP)[REQUESTED_ETA_DATE_CUST] Now change the type of the column now to DT_DBTIMESTAMP to accept the valid datetime value.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Hints:&lt;/b&gt;&lt;br /&gt;1) The supported range for SMALLDATETIME is January 1, 1900, through June 6, 2079&lt;br /&gt;2) Notice that the Millisecond part hasn't been solved here yet. If there is a need, Comment on this forum and I'll get back to you ASAP.&lt;div class="blogger-post-footer"&gt;http://feeds.feedburner.com/subhashsubramanyam&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4701270203513738041-6426178697817604514?l=subhashsubramanyam.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://subhashsubramanyam.blogspot.com/2007/07/populating-oracle-timestamp-values-into.html</link><author>noreply@blogger.com (Subhash Subramanyam)</author><thr:total>10</thr:total></item></channel></rss>

