<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Database</title>
        <link>http://geekswithblogs.net/tmurphy/category/4229.aspx</link>
        <description>Database</description>
        <language>en-US</language>
        <copyright>Tim Murphy</copyright>
        <managingEditor>twmurph@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>What Is INET_ATON And Why Is It In A Database</title>
            <link>http://geekswithblogs.net/tmurphy/archive/2011/03/22/what-is-inet_aton-and-why-is-it-in-a-database.aspx</link>
            <description>&lt;p&gt;While converting some MySql databases to SQL Server I ran across this function.  Confused by the lack of hints to its purpose in the name I did what any red-blooded IT person would do…  look it up.  It turns out that this function turns the string representation of an IP address into a long integer.  What good that does I am still not sure, but here is the jist of the operation.&lt;/p&gt;  &lt;p&gt;&lt;code&gt;(octet1 * 256^3) + (octet2 * 256^2) + (octet3 * 256) + octet4&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Simple enough, right?  Now for the real question.  What the heck is this function doing in the database?  My only thought is that it is faster to search an integer than a string, but to my way of thought this function has nothing to do with normal database operations and doesn’t belong.  A value like this should be converted to an integer by your business logic and passed into the database.  Your DBMS should not be concerned with IP infrastructure.  Of course that is jus my opinion and I would love to hear what others think.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f6329d3c-f96e-4a83-8515-84557c147c47" class="wlWriterEditableSmartContent"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/SQL" rel="tag"&gt;SQL&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/DBMS" rel="tag"&gt;DBMS&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/SQL+Server" rel="tag"&gt;SQL Server&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/MySQL" rel="tag"&gt;MySQL&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/INET_ATON" rel="tag"&gt;INET_ATON&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/tmurphy/aggbug/144473.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Murphy</dc:creator>
            <guid>http://geekswithblogs.net/tmurphy/archive/2011/03/22/what-is-inet_aton-and-why-is-it-in-a-database.aspx</guid>
            <pubDate>Tue, 22 Mar 2011 05:18:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tmurphy/comments/144473.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tmurphy/archive/2011/03/22/what-is-inet_aton-and-why-is-it-in-a-database.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tmurphy/comments/commentRss/144473.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tmurphy/services/trackbacks/144473.aspx</trackback:ping>
        </item>
        <item>
            <title>Creating Parent-Child Relationships in SSRS</title>
            <link>http://geekswithblogs.net/tmurphy/archive/2011/02/14/creating-parent-child-relationships-in-ssrs.aspx</link>
            <description>&lt;p&gt;As I have been working on SQL Server Reporting Services reports the last couple of weeks I ran into a scenario where I needed to present a parent-child data layout.  It is rare that I have seen a report that was a simple tabular or matrix format and this report continued that trend.  I found that the processes for developing complex SSRS reports aren’t as commonly described as I would have thought.  Below I will layout the process that I went through to create a solution.&lt;/p&gt;  &lt;p&gt;I started with a List control which will contain the layout of the master (parent) information.  This allows for a main repeating report part.  The dataset for this report should include the data elements needed to be passed to the subreport as parameters.  As you can see the layout is simply text boxes that are bound to the dataset.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ssrs_mainreport_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ssrs_mainreport" border="0" alt="ssrs_mainreport" src="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ssrs_mainreport_thumb.jpg" width="542" height="540" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The next step is to set a row group on the List row.  When the dialog appears select the field that you wish to group your report by.  A good example in this case would be the employee name or ID.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ScreenHunter_03%20Feb.%2014%2022.18_2.gif"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ScreenHunter_03 Feb. 14 22.18" border="0" alt="ScreenHunter_03 Feb. 14 22.18" src="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ScreenHunter_03%20Feb.%2014%2022.18_thumb.gif" width="333" height="288" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Create a second report which becomes the subreport.  The example below has a matrix control.  Create the report as you would any parameter driven document by parameterizing the dataset.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ScreenHunter_01%20Feb.%2014%2022.14_2.gif"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ScreenHunter_01 Feb. 14 22.14" border="0" alt="ScreenHunter_01 Feb. 14 22.14" src="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/ScreenHunter_01%20Feb.%2014%2022.14_thumb.gif" width="564" height="256" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Add the subreport to the main report inside the row of the List control.  This can be accomplished by either dragging the report from the solution explorer or inserting a Subreport control and then setting the report name property.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/image_thumb_1.png" width="547" height="542" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The last step is to set the parameters on the subreport.  In this case the subreport has EmpId and ReportYear as parameters.  While some of the documentation on this states that the dialog will automatically detect the child parameters, but this has not been my experience.  You must make sure that the names match exactly.  Tie the name of the parameter to either a field in the dataset or a parameter of the parent report.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/tmurphy/Windows-Live-Writer/Creating-Parent-Child-Relationships-in-S_662D/image_thumb.png" width="545" height="446" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:32bcdedc-995d-4ac2-a0db-4cd0e0d2a18e" class="wlWriterEditableSmartContent"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/SQL+Server+Reporting+Services" rel="tag"&gt;SQL Server Reporting Services&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/SSRS" rel="tag"&gt;SSRS&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/SQL+Server" rel="tag"&gt;SQL Server&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Subreports" rel="tag"&gt;Subreports&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/tmurphy/aggbug/143940.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Murphy</dc:creator>
            <guid>http://geekswithblogs.net/tmurphy/archive/2011/02/14/creating-parent-child-relationships-in-ssrs.aspx</guid>
            <pubDate>Mon, 14 Feb 2011 22:47:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tmurphy/comments/143940.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tmurphy/archive/2011/02/14/creating-parent-child-relationships-in-ssrs.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tmurphy/comments/commentRss/143940.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tmurphy/services/trackbacks/143940.aspx</trackback:ping>
        </item>
        <item>
            <title>Fun with Oracle CLOBs</title>
            <link>http://geekswithblogs.net/tmurphy/archive/2006/04/13/75108.aspx</link>
            <description>&lt;P&gt;We have been having prolonged adventures with this wonderful data type on my current project.&amp;nbsp; We are storing XML data in a CLOB field.&amp;nbsp; In the beginning we used the Oracle ODP.NET provider.&amp;nbsp; When we got into performance testing we found that saving this data killed our performance.&amp;nbsp; A couple of the developers did some testing and found that the Microsoft Oracle provider worked at least an order of magnitude better.&amp;nbsp; I was a little skeptical about moving to the Microsoft provider because I remembered that certain database condition weren't reported very well, but time lines always win.&lt;/P&gt;
&lt;P&gt;A short time later the client got a response from Oracle saying we should use a VarChar parameter to send data to a&amp;nbsp;CLOB in the database.&amp;nbsp; We did some testing and it did perform well,&amp;nbsp;but we figured we had changed enough data access code at this point that we would wait until a maintenance release to consider performing the change.&lt;/P&gt;
&lt;P&gt;The system went into pilot and suddenly we started getting failures to insert into the table.&amp;nbsp; Again the developers did some research and found that any data over 32K would cause this condition.&lt;/P&gt;
&lt;P&gt;The solution?&amp;nbsp; Go back to Oracle's suggestion.&lt;/P&gt;
&lt;P&gt;The moral?&amp;nbsp; Take your medicine now.&amp;nbsp; It taste worse if you wait.&lt;/P&gt; &lt;img src="http://geekswithblogs.net/tmurphy/aggbug/75108.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Murphy</dc:creator>
            <guid>http://geekswithblogs.net/tmurphy/archive/2006/04/13/75108.aspx</guid>
            <pubDate>Thu, 13 Apr 2006 22:26:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tmurphy/comments/75108.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tmurphy/archive/2006/04/13/75108.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tmurphy/comments/commentRss/75108.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tmurphy/services/trackbacks/75108.aspx</trackback:ping>
        </item>
        <item>
            <title>The Importance of Having the Right Index</title>
            <link>http://geekswithblogs.net/tmurphy/archive/2006/03/21/72846.aspx</link>
            <description>&lt;P&gt;Here is another story from the trenches.&amp;nbsp; My current project was having mysterious errors coming from its Oracle database, but only under load.&amp;nbsp; Specifically we were getting the following:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;ORA-01013: user requested cancel of current operation&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;This one had me stumped.&amp;nbsp; How could this happen.&amp;nbsp; I searched the code line by line.&amp;nbsp; I got assurances from the testing team that the testing tool was waiting for the last byte to return before navigating away from the page.&amp;nbsp; I scoured the web for any hint of what could cause this.&lt;/P&gt;
&lt;P&gt;We ran some more tests with the DBA monitoring the database.&amp;nbsp; What we found was large number of locks being held for an unusually long time.&amp;nbsp; This of course results in other requests being blocked and eventually timing out.&lt;/P&gt;
&lt;P&gt;Unfortunately I couldn't execute my own explain plans.&amp;nbsp; For any who don't already know, this is a function within Oracle that tells you the cost of the query you are trying to execute.&amp;nbsp; Once the DBA ran them for us it showed that the query that was getting a lock was doing a table scan.&amp;nbsp; It was reading row by row until it finally found the one it was looking for.&lt;/P&gt;
&lt;P&gt;We added an index specifically for this query and the result was that the locks were being released so quickly that the DBA's monitoring tool didn't even see them.&lt;/P&gt;
&lt;P&gt;Lesson:&amp;nbsp;Know they query plan!&lt;/P&gt; &lt;img src="http://geekswithblogs.net/tmurphy/aggbug/72846.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Murphy</dc:creator>
            <guid>http://geekswithblogs.net/tmurphy/archive/2006/03/21/72846.aspx</guid>
            <pubDate>Tue, 21 Mar 2006 05:35:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tmurphy/comments/72846.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tmurphy/archive/2006/03/21/72846.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tmurphy/comments/commentRss/72846.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tmurphy/services/trackbacks/72846.aspx</trackback:ping>
        </item>
    </channel>
</rss>
