<?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>SQLBlog Nederland</title>
	<atom:link href="http://www.sqlblog.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlblog.nl</link>
	<description>Business Intelligence &#38; Datawarehousing</description>
	<lastBuildDate>Wed, 16 May 2012 07:20:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Script to Reset Ident Column in Database</title>
		<link>http://www.sqlblog.nl/2012/05/script-to-reset-ident-column-in-database/</link>
		<comments>http://www.sqlblog.nl/2012/05/script-to-reset-ident-column-in-database/#comments</comments>
		<pubDate>Mon, 14 May 2012 11:25:35 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[ident]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=1024</guid>
		<description><![CDATA[This is a very handy little script to generate a script to reset the ident column of all your database tables. This can be handy after filling and truncating tables. This script uses a schema &#8220;ps&#8221;. Replace it with .dbo if needed. SELECT ' GO DBCC CHECKIDENT(''ps.' + TabelNaam + ''',RESEED,0)' &#160; FROM -- LT: [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very handy little script to generate a script to reset the ident column of all your database tables. This can be handy after filling and truncating tables. This script uses a schema &#8220;ps&#8221;. Replace it with .dbo if needed.</p>
<p><span id="more-1024"></span></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'
GO
DBCC CHECKIDENT('</span><span style="color: #ff0000;">'ps.'</span> <span style="color: #66cc66;">+</span> TabelNaam  <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">''</span><span style="color: #ff0000;">',RESEED,0)'</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">FROM</span>
<span style="color: #808080; font-style: italic;">-- LT: Linked Tables</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> O<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> TabelNaam
<span style="color: #66cc66;">,</span> S<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> SchemaName
<span style="color: #993333; font-weight: bold;">FROM</span> sysobjects <span style="color: #993333; font-weight: bold;">AS</span> O
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">OUTER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>schemas <span style="color: #993333; font-weight: bold;">AS</span> S <span style="color: #993333; font-weight: bold;">ON</span> O<span style="color: #66cc66;">.</span>uid <span style="color: #66cc66;">=</span> S<span style="color: #66cc66;">.</span>schema_id
<span style="color: #993333; font-weight: bold;">WHERE</span> O<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TYPE</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'u'</span> <span style="color: #993333; font-weight: bold;">AND</span> O<span style="color: #66cc66;">.</span>uid<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">5</span>
<span style="color: #993333; font-weight: bold;">AND</span> CHARINDEX<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'_'</span><span style="color: #66cc66;">,</span>O<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>
<span style="color: #808080; font-style: italic;">--ORDER BY O.[name]</span>
<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> LT
<span style="color: #993333; font-weight: bold;">WHERE</span> SchemaName <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'ps'</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> TabelNaam</pre></div></div>

<p>&nbsp;</p>
<p>Usefull to export the output to text in stead of grid.</p>
<p><a href="http://www.sqlblog.nl/wp-content/uploads/2012/05/result_to_text1.jpg"><img class="aligncenter size-full wp-image-1027" title="result_to_text" src="http://www.sqlblog.nl/wp-content/uploads/2012/05/result_to_text1.jpg" alt="" width="727" height="415" /></a></p>
<p>After running the script, copy the result to a new window and run it!</p>
<p style="text-align: center;"><a href="http://www.sqlblog.nl/wp-content/uploads/2012/05/reset_ident.jpg"><img class="aligncenter  wp-image-1026" title="reset_ident" src="http://www.sqlblog.nl/wp-content/uploads/2012/05/reset_ident.jpg" alt="" width="769" height="490" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/05/script-to-reset-ident-column-in-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to count nr of rows in all tables</title>
		<link>http://www.sqlblog.nl/2012/05/script-to-count-nr-of-rows-in-all-tables/</link>
		<comments>http://www.sqlblog.nl/2012/05/script-to-count-nr-of-rows-in-all-tables/#comments</comments>
		<pubDate>Mon, 14 May 2012 10:58:44 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=1015</guid>
		<description><![CDATA[This script can be used as a view to count the number of rows in all SQL tables in your database. This can be very usefull. CREATE VIEW &#91;dbo&#93;.&#91;vwTableListRowCount&#93; AS -- EXAMLE -- SELECT * FROM vwTableListRowCount ORDER BY TableName SELECT TOP 100 PERCENT O.name AS TableName, s.name AS SchemaName, I.rowcnt AS NrOfRecords FROM sysobjects [...]]]></description>
			<content:encoded><![CDATA[<p>This script can be used as a view to count the number of rows in all SQL tables in your database. This can be very usefull.</p>
<p><span id="more-1015"></span></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> <span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>vwTableListRowCount<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #808080; font-style: italic;">-- EXAMLE</span>
<span style="color: #808080; font-style: italic;">-- SELECT * FROM vwTableListRowCount ORDER BY TableName</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> TOP <span style="color: #cc66cc;">100</span> PERCENT O<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> TableName<span style="color: #66cc66;">,</span>
    s<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> SchemaName<span style="color: #66cc66;">,</span>
    I<span style="color: #66cc66;">.</span>rowcnt <span style="color: #993333; font-weight: bold;">AS</span> NrOfRecords
<span style="color: #993333; font-weight: bold;">FROM</span> sysobjects <span style="color: #993333; font-weight: bold;">AS</span> O
    <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> sysindexes <span style="color: #993333; font-weight: bold;">AS</span> I <span style="color: #993333; font-weight: bold;">ON</span> O<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> I<span style="color: #66cc66;">.</span>id
    <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>schemas <span style="color: #993333; font-weight: bold;">AS</span> S <span style="color: #993333; font-weight: bold;">ON</span> O<span style="color: #66cc66;">.</span>uid <span style="color: #66cc66;">=</span> S<span style="color: #66cc66;">.</span>schema_id
<span style="color: #993333; font-weight: bold;">WHERE</span>  I<span style="color: #66cc66;">.</span>indid <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #993333; font-weight: bold;">AND</span> O<span style="color: #66cc66;">.</span>xtype <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'u'</span>
    <span style="color: #993333; font-weight: bold;">AND</span> O<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>name<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'sysdiagrams'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'dtproperties'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> O<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>name<span style="color: #66cc66;">&#93;</span></pre></div></div>

<p><a href="http://www.sqlblog.nl/wp-content/uploads/2012/05/tableRowCount.jpg"><img class="aligncenter size-full wp-image-1018" title="tableRowCount" src="http://www.sqlblog.nl/wp-content/uploads/2012/05/tableRowCount.jpg" alt="" width="631" height="389" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">&nbsp;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/05/script-to-count-nr-of-rows-in-all-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate Weeks Between Two Dates using DateDiff</title>
		<link>http://www.sqlblog.nl/2012/03/calculate-weeks-between-two-dates-using-datediff/</link>
		<comments>http://www.sqlblog.nl/2012/03/calculate-weeks-between-two-dates-using-datediff/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 11:02:03 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[DateDiff]]></category>
		<category><![CDATA[Functions]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=997</guid>
		<description><![CDATA[In SQL Server, there&#8217;s a buildin function to calculate the number of weeks between two dates. This function is called &#8220;DateDiff&#8221;. The problem with this function is that Sql Server thinks the week starts on sunday. Maybe this it true in some situations but at  my current project,  the week should start on monday. This [...]]]></description>
			<content:encoded><![CDATA[<p>In SQL Server, there&#8217;s a buildin function to calculate the number of weeks between two dates. This function is called &#8220;DateDiff&#8221;. The problem with this function is that Sql Server thinks the week starts on sunday. Maybe this it true in some situations but at  my current project,  the week should start on monday. This article gives you more info how to fix the issue with the datediff and weeks.</p>
<p><span id="more-997"></span>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> DATEDIFF<span style="color: #66cc66;">&#40;</span>wk<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'2012-01-07'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'2012-01-08'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p lang="sql">7th of January is saturday, 8th of January is sunday. The answer from SQL Server is 1. That&#8217;s true because the new week starts on sunday.</p>
<p style="text-align: center;" lang="sql"><a href="http://www.sqlblog.nl/wp-content/uploads/2012/03/datediff_wk.jpg"><img class="aligncenter  wp-image-999" title="datediff_wk" src="http://www.sqlblog.nl/wp-content/uploads/2012/03/datediff_wk.jpg" alt="" width="622" height="158" /></a></p>
<p lang="sql">Ok the problem is clear. How can I fix this problem? After doing some research, I found an article about Visual Basic. In VB, there&#8217;s a simular function to calculate with dates:</p>
<p lang="sql">DateDiff(interval, date1, date2 [,firstdayofweek[, firstweekofyear]])</p>
<p lang="sql">Unfortunately, this last argument isn&#8217;t available in Sql Server. So looking around on the internet, I found this.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LANGUAGE</span> Dutch</pre></div></div>

<blockquote>
<p lang="sql">Specifies the language environment for the session. The session language determines the datetime formats and system messages.</p>
</blockquote>
<p lang="sql">After running this SET LANGUAGE command, I run the DateDiff command again:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> DATEDIFF<span style="color: #66cc66;">&#40;</span>wk<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'2012-01-07'</span> <span style="color: #993333; font-weight: bold;">AS</span> DATETIME<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'2012-01-08'</span> <span style="color: #993333; font-weight: bold;">AS</span> DATETIME<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>And the answer? 4. I don&#8217;t understand this. How can this be possible? I think because in Dutch, the date notation is YYYYDDMM so SQL server thinks that I mean July &#8211; August and then the answer is correct.</p>
<p lang="sql">When I reverse the month and day:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> DATEDIFF<span style="color: #66cc66;">&#40;</span>wk<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'2012-07-01'</span> <span style="color: #993333; font-weight: bold;">AS</span> DATETIME<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'2012-08-01'</span> <span style="color: #993333; font-weight: bold;">AS</span> DATETIME<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span></pre></div></div>

<p lang="sql">I get the answer: 1. Conclusion: this function will ignore the language setting  and always perform the calculation assuming Sunday as the first day of the week.</p>
<p lang="sql">This is also interesting; when I cast an integer to datetime, the language setting will be ignored:</p>
<p lang="sql"><a href="http://www.sqlblog.nl/wp-content/uploads/2012/03/datadiff_2.jpg"><img class="size-full wp-image-1004 aligncenter" title="datadiff_2" src="http://www.sqlblog.nl/wp-content/uploads/2012/03/datadiff_2.jpg" alt="" width="464" height="283" /></a></p>
<p lang="sql">There is a workaround for this issue. I found the function @@DATEFIRST. I never have used this one before. Try this:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LANGUAGE</span> Dutch
<span style="color: #993333; font-weight: bold;">SELECT</span> @@DATEFIRST;
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LANGUAGE</span> us_english
<span style="color: #993333; font-weight: bold;">SELECT</span> @@DATEFIRST;</pre></div></div>

<p lang="sql">This function returns a number, the first day of the week. In the Netherlands, it is 1. This means monday. In US, it&#8217;s 7 and means sunday. So by knowing this, I can create a nice statement to do the calculation.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LANGUAGE</span> Dutch;
<span style="color: #993333; font-weight: bold;">SELECT</span> DATEDIFF<span style="color: #66cc66;">&#40;</span> week<span style="color: #66cc66;">,</span>
DATEADD<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DAY</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">-</span>@@DATEFIRST<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'20091227'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
DATEADD<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DAY</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">-</span>@@DATEFIRST<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'20091228'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p lang="sql">Answer: 1 = Correct.</p>
<p lang="sql">Easy way: we know that @@DATEFIRST always returns 1 in my situation. So this also works:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> DATEDIFF<span style="color: #66cc66;">&#40;</span> week<span style="color: #66cc66;">,</span>
DATEADD<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DAY</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'20120108'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
DATEADD<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DAY</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'20120109'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> WeekDifference;</pre></div></div>

<p lang="sql">Friday to Saturday becomes Thursday to Friday: Difference = 0 weeks (before: 0 weeks)<br />
Saturday to Sunday becomes Friday to Saturday: Difference = 0 weeks (before: 1 week)<br />
Sunday to Monday becomes Saturday to Sunday: Difference = 1 weeks (before: 0 week)</p>
<p lang="sql">Hope this helps you implementing the DateDiff function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/03/calculate-weeks-between-two-dates-using-datediff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gratis E-Book: Introducing Microsoft SQL Server 2012</title>
		<link>http://www.sqlblog.nl/2012/03/gratis-e-book-introducing-microsoft-sql-server-2012/</link>
		<comments>http://www.sqlblog.nl/2012/03/gratis-e-book-introducing-microsoft-sql-server-2012/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 12:31:54 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[e-book. sql server]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=994</guid>
		<description><![CDATA[Gratis e-book van Microsoft te download op deze website: Friends, the final and complete version of Introducing Microsoft SQL Server 2012, by Ross Mistry (@RossMistry) and Stacia Misner (@StaciaMisner), is now ready as a free download! You can download the PDF version of this title here (288 pages; 10.8 MB). We will update this post soon [...]]]></description>
			<content:encoded><![CDATA[<p>Gratis e-book van Microsoft te download op <a href="http://blogs.msdn.com/b/microsoft_press/archive/2012/03/15/free-ebook-introducing-microsoft-sql-server-2012.aspx">deze website:</a></p>
<p>Friends, the final and complete version of <em>Introducing Microsoft SQL Server 2012</em>, by Ross Mistry (<a href="http://twitter.com/#%21/RossMistry">@RossMistry</a>) and Stacia Misner (<a href="http://twitter.com/#%21/StaciaMisner">@StaciaMisner</a>), is now ready as a free download! You can <a href="http://download.microsoft.com/download/F/F/6/FF62CAE0-CE38-4228-9025-FBF729312698/Microsoft_Press_eBook_Introducing_Microsoft_SQL_Server_2012_PDF.pdf">download the PDF version of this title here</a> (288 pages; 10.8 MB).</p>
<p>We will update this post soon with links to EPUB and MOBI files. We expect these files to be available by March 23. <strong>UPDATE:</strong> The <a href="http://download.microsoft.com/download/C/2/D/C2DF91A1-3C7C-4965-BB16-CAB02F8262B9/Microsoft_Press_eBook_Introducing_Microsoft_SQL_Server_2012_EPUB.epub">EPUB is here</a>, and the <a href="http://download.microsoft.com/download/C/2/D/C2DF91A1-3C7C-4965-BB16-CAB02F8262B9/Microsoft_Press_eBook_Introducing_Microsoft_SQL_Server_2012_MOBI.mobi">MOBI is here</a>.</p>
<p>If you prefer a hard copy of the book, <a href="http://shop.oreilly.com/product/0790145342201.do">you can order it here for $14.99</a>.</p>
<p><em>Introducing Microsoft SQL Server 2012</em> includes 10 chapters:</p>
<blockquote><p>PART I   DATABASE ADMINISTRATION (by Ross Mistry)</p>
<p>1.   SQL Server 2012 Editions and Engine Enhancements</p>
<p>2.   High-Availability and Disaster-Recovery Enhancements</p>
<p>3.   Performance and Scalability</p>
<p>4.   Security Enhancements</p>
<p>5.   Programmability and Beyond-Relational Enhancements</p>
<p>PART II   BUSINESS INTELLIGENCE DEVELOPMENT (by Stacia Misner)</p>
<p>6.   Integration Services</p>
<p>7.   Data Quality Services</p>
<p>8.   Master Data Services</p>
<p>9.   Analysis Services and PowerPivot</p>
<p>10.   Reporting Services</p></blockquote>
<p>We are releasing this title to help you learn about the new features and capabilities in SQL Server 2012, which Microsoft released to manufacturing (RTM) on March 6, 2012. You can expect general availability of the product to begin on April 1, 2012.</p>
<p>Please help us share the news about this ebook. And enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/03/gratis-e-book-introducing-microsoft-sql-server-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Datawarehouse and Datamart &#8211; Empty Strings or NULL Values?</title>
		<link>http://www.sqlblog.nl/2012/03/datawarehousedatamart-empty-strings-or-null-values/</link>
		<comments>http://www.sqlblog.nl/2012/03/datawarehousedatamart-empty-strings-or-null-values/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 09:58:45 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[BI en Datawarehousing]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=990</guid>
		<description><![CDATA[I was wondering what&#8217;s the best method to store empty fields from source systems in a datawarehouse. For example;a customer record without a first name stored in the database. When loading this record in my datawarehouse, should I set this field to NULL (to save space) or should I load the original value, maybe an [...]]]></description>
			<content:encoded><![CDATA[<p>I was wondering what&#8217;s the best method to store empty fields from source systems in a datawarehouse. For example;a customer record without a first name stored in the database. When loading this record in my datawarehouse, should I set this field to NULL (to save space) or should I load the original value, maybe an empty string?<br />
<span id="more-990"></span>There is no good answer to this question. It depends on the architecture and rules. When you use a Data Vault to store your data, you should always use the original value from source without cleansing this data, that&#8217;s a rule. But after this data vault, there is a data mart with clean data. Should I set these kinds of values to NULL or should I use empty strings?</p>
<p>My experience is when using NULL values you need to remember a rule. When concatenating fields like building an adress or full name, you will do someting like this:</p>
<p>SELECT FirstName + &#8216; &#8216; + LastName FROM dbo.Customer</p>
<p>When the FirstName is empty, the result will be NULL. So when you use NULL as FirstName, you should alway do an extra check for non empty values:</p>
<p>SELECT ISNULL(FirstName,&#8221;) + &#8216; &#8216; + ISNULL(LastName,&#8221;) FROM dbo.Customer</p>
<p>Also a very important note is when using numbers. Maybe you have three columns in your datamart for profit which you need to SUM in your report. When one column contains a NULL value, the result will be NULL!</p>
<p>Column1        Column2        Column3<br />
3                        NULL               2</p>
<p>SELECT Column1 + Column2 + Column3 FROM dbo.Table</p>
<p>Result: 0</p>
<p>Correct way:</p>
<p>SELECT ISNULL(Column1,0) + ISNULL(Column2,0) + ISNULL(Column3,0) FROM dbo.Table</p>
<p>Conclusion:<br />
Consided to store an empty string in a NULL value to prevent concatenation problemns and consider to store the value 0 in columns which are used to sum. Maybe a better solution is the store extra fields in the datamart with concatenated data!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/03/datawarehousedatamart-empty-strings-or-null-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tablix filter met LIKE operator</title>
		<link>http://www.sqlblog.nl/2012/02/tablix-filter-met-like-operator/</link>
		<comments>http://www.sqlblog.nl/2012/02/tablix-filter-met-like-operator/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 12:57:22 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[Reporting Services]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=985</guid>
		<description><![CDATA[De LIKE operator in Reporting Services werkt net iets anders dan in SQL. Je verwacht namelijk dat je met een % kunt werken.  Niets is minder waar, erg consistent dus. Als je de LIKE operator wilt gebruiker in bijvoorbeeld de TABLIX ga je naar Tablix properties, Filter: Bij Expression vul je in op welke kolom [...]]]></description>
			<content:encoded><![CDATA[<p>De LIKE operator in Reporting Services werkt net iets anders dan in SQL. Je verwacht namelijk dat je met een % kunt werken.  Niets is minder waar, erg consistent dus.</p>
<p><span id="more-985"></span></p>
<p>Als je de LIKE operator wilt gebruiker in bijvoorbeeld de TABLIX ga je naar Tablix properties, Filter:</p>
<p><a href="http://www.sqlblog.nl/wp-content/uploads/2012/02/filter_1.jpg"><img class="aligncenter size-medium wp-image-986" title="filter_1" src="http://www.sqlblog.nl/wp-content/uploads/2012/02/filter_1-288x300.jpg" alt="" width="288" height="300" /></a>Bij Expression vul je in op welke kolom in je dataset je wilt filteren.  Daarna kies je bij Operator de LIKE. Bij de expressie (klik op het knopje Fx) ga je de volgende expressie invoeren</p>
<p>= &#8220;*&#8221; &amp; &#8220;tekst&#8221; &amp; &#8220;*&#8221;</p>
<p><a href="http://www.sqlblog.nl/wp-content/uploads/2012/02/filter_2.jpg"><img class="aligncenter size-medium wp-image-987" title="Filter LIKE" src="http://www.sqlblog.nl/wp-content/uploads/2012/02/filter_2-300x161.jpg" alt="" width="300" height="161" /></a></p>
<p>Alle records met het woord &#8220;tekst&#8221; worden nu gefilterd.</p>
<p>Alles is zo eenvoudig als je het weet</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2012/02/tablix-filter-met-like-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ontvang het boek &#8216;Datavault implementeren met Pentaho integratie&#8217; gratis</title>
		<link>http://www.sqlblog.nl/2011/12/ontvang-het-boek-datavault-implementeren-met-pentaho-integratie-gratis/</link>
		<comments>http://www.sqlblog.nl/2011/12/ontvang-het-boek-datavault-implementeren-met-pentaho-integratie-gratis/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 12:56:50 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[Overige]]></category>
		<category><![CDATA[E-Books]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=981</guid>
		<description><![CDATA[Ontvang het boek &#8216;Datavault implementeren met Pentaho integratie&#8217; gratis Dit boek is een zelfstudie voor Pentaho Data Integratie en geeft praktijkervaring in het samenstellen van een datavault architectuur. De opdrachten resulteren in een werkende oplossing die als basis kan worden gebruikt voor een BI oplossing in uw eigen omgeving. Het boek is te koop via: [...]]]></description>
			<content:encoded><![CDATA[<p>Ontvang het boek &#8216;Datavault implementeren met Pentaho integratie&#8217; gratis</p>
<blockquote><p>Dit boek is een zelfstudie voor Pentaho Data Integratie en geeft praktijkervaring in het samenstellen van een datavault architectuur. De opdrachten resulteren in een werkende oplossing die als basis kan worden gebruikt voor een BI oplossing in uw eigen omgeving. Het boek is te koop via: <a href="http://bit.ly/datavaultimplementeren" target="_blank">http://bit.ly/datavaultimplementeren</a> U kunt dit boek gratis ontvangen als hardcopy en als PDF. Vul het onderstaande formulier in en u ontvangt het boek tijdens een persoonlijk gesprek gratis.</p></blockquote>
<p>&nbsp;</p>
<p><a href="https://docs.google.com/a/kraaitje.nl/spreadsheet/viewform?hl=nl&amp;formkey=dHVUOXhGSi1mTkg3cV8zUEFRM0FiTlE6MQ&amp;theme=0AX42CRMsmRFbUy0xOGQxNWI3Yi01NzQzLTQ1ZjUtOTk4OS1kODRlZWIwNjMxZTU&amp;ifq">Klik hier voor de website.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2011/12/ontvang-het-boek-datavault-implementeren-met-pentaho-integratie-gratis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sql Server 2012 Training Kit gratis download</title>
		<link>http://www.sqlblog.nl/2011/12/sql-server-2012-training-kit-gratis-download/</link>
		<comments>http://www.sqlblog.nl/2011/12/sql-server-2012-training-kit-gratis-download/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 10:45:10 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[Overige]]></category>
		<category><![CDATA[E-Books]]></category>
		<category><![CDATA[Sql Server 2012]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=976</guid>
		<description><![CDATA[SQL Server 2012 Developer Training Kit Web Installer Preview is nu gratis te downloaden op de Microsoft Website hier. The SQL Server 2012 Developer Training Kit includes technical content including labs, demos and presentations designed to help you learn how to develop SQL Server 2012 database and BI solutions. New and updated content will be [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Server 2012 Developer Training Kit Web Installer Preview is nu gratis te downloaden op de Microsoft Website <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=27721">hier</a>.</p>
<blockquote><p>The SQL Server 2012 Developer Training Kit includes technical content including labs, demos and presentations designed to help you learn how to develop SQL Server 2012 database and BI solutions. New and updated content will be released periodically and can be downloaded on-demand using the Web Installer Preview.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2011/12/sql-server-2012-training-kit-gratis-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beste WordPress Twitter/facebook/google rater</title>
		<link>http://www.sqlblog.nl/2011/12/beste-wordpress-twitterfacebookgoogle-rater/</link>
		<comments>http://www.sqlblog.nl/2011/12/beste-wordpress-twitterfacebookgoogle-rater/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 14:24:08 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=968</guid>
		<description><![CDATA[Ik heb een aantal wordpress social plugins getest en vond deze de beste: WordPress Social Ring Deze plugin ondersteunt Google+, Twitter, Facebook Like/Share en ook de layout is prima. Je kunt de plugin bovenaan berichten en onderaan berichten plaatsen. Daarnaast kun je hem ook op de frontpage toevoegen. &#160;]]></description>
			<content:encoded><![CDATA[<p>Ik heb een aantal wordpress social plugins getest en vond deze de beste: <a title="Wordpress Social Ring" href="http://wordpress.org/extend/plugins/wordpress-social-ring/"><strong>WordPress Social Ring</strong></a></p>
<p>Deze plugin ondersteunt Google+, Twitter, Facebook Like/Share en ook de layout is prima. Je kunt de plugin bovenaan berichten en onderaan berichten plaatsen. Daarnaast kun je hem ook op de frontpage toevoegen.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2011/12/beste-wordpress-twitterfacebookgoogle-rater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog omgezet naar WordPress</title>
		<link>http://www.sqlblog.nl/2011/12/blog-omgezet-naar-wordpresss/</link>
		<comments>http://www.sqlblog.nl/2011/12/blog-omgezet-naar-wordpresss/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 12:01:36 +0000</pubDate>
		<dc:creator>Ronald Kraijesteijn</dc:creator>
				<category><![CDATA[Overige]]></category>

		<guid isPermaLink="false">http://www.sqlblog.nl/?p=960</guid>
		<description><![CDATA[SqlBlog draait vanaf op WordPress]]></description>
			<content:encoded><![CDATA[<p>SqlBlog draait vanaf op WordPress</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlblog.nl/2011/12/blog-omgezet-naar-wordpresss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.sqlblog.nl @ 2012-05-20 05:44:53 -->
