<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Doens.be &#187; SQL</title>
	<atom:link href="http://www.doens.be/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doens.be</link>
	<description></description>
	<lastBuildDate>Sat, 07 Jan 2012 04:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Monitoring Table Size Growth in SQL Server</title>
		<link>http://www.doens.be/2011/03/monitoring-table-size-growth-in-sql-server/</link>
		<comments>http://www.doens.be/2011/03/monitoring-table-size-growth-in-sql-server/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 05:00:03 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=827</guid>
		<description><![CDATA[During my vacation I came across a older, but interesting article that shows you how you can monitor table size growth in SQL-server. With a bit of creativity you can create interesting report based on this information or you can just use the examples on the second page.]]></description>
			<content:encoded><![CDATA[<p>During my vacation I came across a older, but interesting article that shows you how you can <a title="Monitoring Table Size Growth in SQL Server" href="http://www.sql-server-performance.com/articles/dba/monitor_data_growth_p1.aspx" target="_blank">monitor table size growth in SQL-server</a>. With a bit of creativity you can create interesting report based on this information or you can just use the examples on the second page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2011/03/monitoring-table-size-growth-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Index vs Index hint</title>
		<link>http://www.doens.be/2010/10/index-vs-index-hint/</link>
		<comments>http://www.doens.be/2010/10/index-vs-index-hint/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 05:00:34 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=757</guid>
		<description><![CDATA[This is a discussion I had with several colleagues. What is the difference between index and index hint and what do we use in our code? There are a lot of misunderstandings about what these keywords actually  do. When you use the index keyword in a select statement the kernel will translate this to a [...]]]></description>
			<content:encoded><![CDATA[<p>This is a discussion I had with several colleagues. What is the difference between <strong>index</strong> and <strong>index hint</strong> and what do we use in our code?</p>
<p><span id="more-757"></span>There are a lot of misunderstandings about what these keywords actually  do. When you use the <strong>index</strong> keyword in a select statement the kernel will translate this to a <strong>order by</strong> command and the database optimizer will chose the best index to actually use. When you chose to use the<strong> index hint</strong> keyword in your select statement, Ax will <strong>force</strong> the database to use the chosen <strong>index</strong>.</p>
<p>Now what guideline should you use in writing your select statement? Index / Index hint or should you write nothing and let Ax decide what to do with the query. There are pro&#8217;s and con&#8217;s for all decisions.<br />
Some people have no trust in the common sense of the developer and say <em>&#8216;let the database optimizer chose&#8217;</em>, it will know what&#8217;s best.<br />
Personally I&#8217;m a big fan of using the index keyword in all your select statement because you it forces you to think about the indexes that are available on the table or if you should add a extra index to optimize the database-call for your SQL statement. In the end, the database optimizer can chose what the best index is to use.</p>
<p>If anyone has a opinion about this matter, don&#8217;t hesitate to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/10/index-vs-index-hint/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using &#8216;Not Like&#8217; in Ax X++</title>
		<link>http://www.doens.be/2009/10/using-not-like-in-ax-x/</link>
		<comments>http://www.doens.be/2009/10/using-not-like-in-ax-x/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:22:42 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[JOIN]]></category>
		<category><![CDATA[LIKE]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=266</guid>
		<description><![CDATA[When you want to use wild-cards in Ax, you can write a SQL statement with a LIKE keyword 1 2 select firstonly purchTable where purchTable.purchId like '09*'; When you want to have all the other records (not like), in X++ SQL-statements you have 3 possibilities: 1.!LIKE : 1 2 select firstonly purchTable where !&#40;purchTable.purchId like [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to use wild-cards in Ax, you can write a SQL statement with a LIKE keyword</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
<span style="color: #0000ff;">where</span> purchTable.<span style="color: #000000;">purchId</span> <span style="color: #0000ff;">like</span> <span style="color: #ff0000;">'09*'</span>;</pre></td></tr></table></div>

<p>When you want to have all the other records (not like), in X++ SQL-statements you have 3 possibilities:<br />
1.!LIKE :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
<span style="color: #0000ff;">where</span> <span style="color: #00007f;">!</span><span style="color: #000000;">&#40;</span>purchTable.<span style="color: #000000;">purchId</span> <span style="color: #0000ff;">like</span> <span style="color: #ff0000;">'09*'</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>2. notExists join :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
    <span style="color: #0000ff;">notExists</span> <span style="color: #0000ff;">join</span> refPurchTable
    <span style="color: #0000ff;">where</span> purchTable.<span style="color: #000000;">purchId</span> <span style="color: #00007f;">==</span> <span style="color: #ff0000;">'09*'</span>;</pre></td></tr></table></div>

<p>3. Query-object :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">Query query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> Query<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
QueryRun queryRun;
; 
query.<span style="color: #000000;">addDataSource</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">tableNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">addRange</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">fieldNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #00007f;">,</span> PurchId<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'!09*'</span><span style="color: #000000;">&#41;</span>;
queryRun <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> QueryRun<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;
<span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>queryRun.<span style="color: #0000ff;">next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    purchTable <span style="color: #00007f;">=</span> queryRun.<span style="color: #000000;">get</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">tableNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">print</span> purchTable.<span style="color: #000000;">PurchId</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0000ff;">pause</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2009/10/using-not-like-in-ax-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

