<?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>SQL Server Wave &#187; Arif</title>
	<atom:link href="http://www.sqlserverwave.com/author/Arif/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlserverwave.com</link>
	<description>Views and Tips on SQL Server</description>
	<lastBuildDate>Fri, 22 Jul 2011 07:48:30 +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>Denali Contained Databases Not Compatible with Replication</title>
		<link>http://www.sqlserverwave.com/2011/07/21/denali-contained-database-not-compatible-with-replication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=denali-contained-database-not-compatible-with-replication</link>
		<comments>http://www.sqlserverwave.com/2011/07/21/denali-contained-database-not-compatible-with-replication/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 10:58:20 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=249</guid>
		<description><![CDATA[I very much liked the idea of Contained Databases as it would make it much easier to move databases across different servers and even use this feature as part of a disaster recovery strategy. Here is really good article that explains how Contained Databases work in Denali: http://www.sqldbadiaries.com/2011/02/01/contained-databases-in-sql-server-denali/ While very excited about this feature, I [...]]]></description>
			<content:encoded><![CDATA[<p>I very much liked the idea of Contained Databases as it would make it much easier to move databases across different servers and even use this feature as part of a disaster recovery strategy. Here is really good article that explains how Contained Databases work in Denali:</p>
<p><a title="Contained Databases in Denali" href="http://www.sqldbadiaries.com/2011/02/01/contained-databases-in-sql-server-denali/" target="_blank">http://www.sqldbadiaries.com/2011/02/01/contained-databases-in-sql-server-denali/</a></p>
<p>While very excited about this feature, I came across a big issue as it is not supported on databases that are either part of Replication, Change Data Capture or Change Tracking.</p>
<p>Now, as most of the databases I have in production are replicated in one way or another, it simply will not be possible to use it.</p>
<p><a href="http://www.sqlserverwave.com/wp-content/uploads/2011/07/Contained-Database-Error2.png"><img class="aligncenter size-full wp-image-255" title="Contained Database Error" src="http://www.sqlserverwave.com/wp-content/uploads/2011/07/Contained-Database-Error2.png" alt="" width="613" height="602" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2011/07/21/denali-contained-database-not-compatible-with-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy VMware for testing</title>
		<link>http://www.sqlserverwave.com/2011/07/21/easy-vmware-for-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=easy-vmware-for-testing</link>
		<comments>http://www.sqlserverwave.com/2011/07/21/easy-vmware-for-testing/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 09:48:26 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Denali]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=238</guid>
		<description><![CDATA[I was looking for an easy way of testing new versions of SQL Servers and Windows Servers without having to invest on another machine or taking the risk of breaking my desktop computer. I then came across VMware player and was surprised to see how easy it was to install it and it did allow [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for an easy way of testing new versions of SQL Servers and Windows Servers without having to invest on another machine or taking the risk of breaking my desktop computer.</p>
<p>I then came across VMware player and was surprised to see how easy it was to install it and it did allow me to do all the testing without ever requiring another machine. In a nutshell, it installs another virtual computer within an existing computer.</p>
<p>These are the steps I followed:</p>
<p style="padding-left: 30px;">1. Download VMware Player (free) from here:</p>
<p style="padding-left: 60px;"><a title="VMware Player" href="http://www.vmware.com/products/player/" target="_blank">http://www.vmware.com/products/player/</a></p>
<p style="padding-left: 30px;">2. Download an Operating System:</p>
<p style="padding-left: 60px;">I downloaded a trial version of Windows Server 2008 R2 which last 180 days, more than enough for my purpose.</p>
<p style="padding-left: 30px;">3. Install VMware player</p>
<p style="padding-left: 60px;">The installation is very much straight forward. While installing, it will ask for an Operating System installation file.</p>
<p>Job done. There is now another machine available in my desktop computer and I can test anything I like. I installed SQL Server Denali CTP3 and enjoyed playing with it without having to worry about breaking my existing setup.</p>
<p>One thing to bear in mind is that the machine on which VMware Player is installed needs to have enough resources to share. When installing VMware, it automatically allocated 40gb of disk space, 1Gb of RAM and 1 CPU. Those setting are entirely customisable.</p>
<p><a href="http://www.sqlserverwave.com/wp-content/uploads/2011/07/VMware-Player.png"><img class="aligncenter size-full wp-image-247" title="VMware Player" src="http://www.sqlserverwave.com/wp-content/uploads/2011/07/VMware-Player.png" alt="VMware Player" width="603" height="372" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2011/07/21/easy-vmware-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two-character month and day in Expression Builder</title>
		<link>http://www.sqlserverwave.com/2010/07/22/two-character-month-and-day-in-expression-builder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=two-character-month-and-day-in-expression-builder</link>
		<comments>http://www.sqlserverwave.com/2010/07/22/two-character-month-and-day-in-expression-builder/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 10:30:53 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=232</guid>
		<description><![CDATA[I needed to set a variable to YYYYMMDD. When using the Month() and Day() function in Expression Builder, it returned a single character back when the value was less than 10. So the value I was getting back was YYYYMD using the following expression: (DT_WSTR, 4) YEAR( GETDATE()  ) + (DT_WSTR,2)DatePart("m", getdate()) + (DT_WSTR,2)DatePart("d", getdate()) [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to set a variable to YYYYMMDD.</p>
<p>When using the Month() and Day() function in Expression Builder, it returned a single character back when the value was less than 10. So the value I was getting back was YYYYMD using the following expression:</p>
<pre>(DT_WSTR, 4) YEAR( GETDATE()  ) + (DT_WSTR,2)DatePart("m", getdate()) + (DT_WSTR,2)DatePart("d", getdate())
</pre>
<p>The workaround is to use the RIGHT() function:</p>
<pre>(DT_WSTR, 4) YEAR( GETDATE()  ) + RIGHT("0" + (DT_WSTR,2)DatePart("m", getdate()), 2) + RIGHT("0" + (DT_WSTR,2)DatePart("d", getdate()), 2)
</pre>
<p>The above will return the right format: YYYYMMDD.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/07/22/two-character-month-and-day-in-expression-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run SQL queries in a batch file</title>
		<link>http://www.sqlserverwave.com/2010/07/14/run-sql-queries-in-a-batch-file/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=run-sql-queries-in-a-batch-file</link>
		<comments>http://www.sqlserverwave.com/2010/07/14/run-sql-queries-in-a-batch-file/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:49:40 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=226</guid>
		<description><![CDATA[I recently had to delete records from a table regularly, every 10 minutes. I first obviously thought of setting up  a SQL Agent Job, easy!!! Now here is my problem, I am using SQL Server Express Edition, which doesn&#8217;t come with SQL Server Agent features. So the SQL way wasn&#8217;t an option. I then realised [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to delete records from a table regularly, every 10 minutes. I first obviously thought of setting up  a SQL Agent Job, easy!!!</p>
<p>Now here is my problem, I am using SQL Server Express Edition, which doesn&#8217;t come with SQL Server Agent features. So the SQL way wasn&#8217;t an option. I then realised that I could setup a scheduled task in Windows (XP) that would run a batch file every 10 minutes, job done!</p>
<p>Here is an example of the batch file:</p>
<pre>@ECHO OFF
cd C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn
SQLCMD -SserverName\instanceName -Uusername -Ppassword -Q"delete from DatabaseName.dbo.TableToDelete"
@ECHO OFF
</pre>
<p>Save it as something like Query.bat and call it via a scheduled task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/07/14/run-sql-queries-in-a-batch-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up email notifications in SQL Server 2005/2008</title>
		<link>http://www.sqlserverwave.com/2010/06/30/setting-up-email-notifications-in-sql-server-2008/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-email-notifications-in-sql-server-2008</link>
		<comments>http://www.sqlserverwave.com/2010/06/30/setting-up-email-notifications-in-sql-server-2008/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:10:28 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=199</guid>
		<description><![CDATA[A business critical SQL Server job failed during the weekend without anyone knowing about it. When some errors are not predictable, a good system should at least send notifications when things go wrong. In this case, it would have been appropriate if an email was sent to the relevant person with as much details possible [...]]]></description>
			<content:encoded><![CDATA[<p>A business critical SQL Server job failed during the weekend without anyone knowing about it. When some errors are not predictable, a good system should at least send notifications when things go wrong. In this case, it would have been appropriate if an email was sent to the relevant person with as much details possible about the error.</p>
<p>In SQL Server, we need to setup the following two features:</p>
<ol>
<li> Firstly, Database Mail; it should be enabled and configured. This has been covered in detail <a title="Database Mail" href="http://www.sqlserverwave.com/2010/06/15/setting-database-mail-on-sql-server-20052008/" target="_self">here</a>.</li>
<li> Secondly, an Operator that will be used by SQL Agent jobs to notify the relevant person or group.</li>
</ol>
<p>Let&#8217;s create a new Operator:</p>
<div id="attachment_200" class="wp-caption aligncenter" style="width: 563px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail14.jpg"><img class="size-full wp-image-200  " title="Right click on Operators and click New Operator..." src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail14.jpg" alt="Right click on Operators and click New Operator..." width="553" height="504" /></a><p class="wp-caption-text">Right click on Operators and click New Operator...</p></div>
<p>In the next step, all we need is specify the email address of the person or group to receive notifications</p>
<div id="attachment_201" class="wp-caption aligncenter" style="width: 581px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail15.jpg"><img class="size-full wp-image-201  " title="Specify an email address" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail15.jpg" alt="Specify an email address" width="571" height="512" /></a><p class="wp-caption-text">Specify an email address</p></div>
<p>Now that the Operator is ready,  any sql agent job can use it</p>
<div id="attachment_202" class="wp-caption aligncenter" style="width: 573px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail16.jpg"><img class="size-full wp-image-202 " title="Job property - notification tab" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail16.jpg" alt="Job property - notification tab" width="563" height="506" /></a><p class="wp-caption-text">Job property - notification tab</p></div>
<p>Last but not least, let&#8217;s make sure that SQL Server Agent is able to use the Database Mail profile</p>
<div id="attachment_218" class="wp-caption aligncenter" style="width: 562px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail11.jpg"><img class="size-full wp-image-218 " title="SQL Server Agent properties" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail11.jpg" alt="SQL Server Agent properties" width="552" height="505" /></a><p class="wp-caption-text">SQL Server Agent properties</p></div>
<p style="text-align: center;">
<div id="attachment_219" class="wp-caption aligncenter" style="width: 573px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail12.jpg"><img class="size-full wp-image-219 " title="Alert System - choose the mail profile to use for sending notifications" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail12.jpg" alt="Alert System - choose the mail profile to use for sending notifications" width="563" height="506" /></a><p class="wp-caption-text">Alert System - choose the mail profile to use for sending notifications</p></div>
<p style="text-align: center;">
<div id="attachment_220" class="wp-caption aligncenter" style="width: 563px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail13.jpg"><img class="size-full wp-image-220 " title="Restart SQL Server Agent" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail13.jpg" alt="Restart SQL Server Agent" width="553" height="505" /></a><p class="wp-caption-text">Restart SQL Server Agent</p></div>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/06/30/setting-up-email-notifications-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting Database Mail on SQL Server 2005/2008</title>
		<link>http://www.sqlserverwave.com/2010/06/15/setting-database-mail-on-sql-server-20052008/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-database-mail-on-sql-server-20052008</link>
		<comments>http://www.sqlserverwave.com/2010/06/15/setting-database-mail-on-sql-server-20052008/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 14:49:21 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=155</guid>
		<description><![CDATA[I was creating a web service that processes data and saves into relevant tables. Should there be any error in the process, an error record was created. Although there are many ways to be alerted when an error occurred, I felt that in this case it was more appropriate to use a Stored Procedure to [...]]]></description>
			<content:encoded><![CDATA[<p>I was creating a web service that processes data and saves into relevant tables. Should there be any error in the process, an error record was created. Although there are many ways to be alerted when an error occurred, I felt that in this case it was more appropriate to use a Stored  Procedure to send an error email.</p>
<p>In SQL Server 2005/2008, the Database Mail feature need to be setup. The Database Mail feature allows SQL Server to send emails to end users. The only pre-requisite is to have an SMTP server available.</p>
<div id="attachment_166" class="wp-caption aligncenter" style="width: 563px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail012.jpg"><img class="size-full wp-image-166" title="DatabaseMail01" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail012.jpg" alt="" width="553" height="505" /></a><p class="wp-caption-text">Right click on Database Mail and check Configure Database Mail...</p></div>
<p style="text-align: center;"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail02.jpg"><img class="aligncenter size-full wp-image-169" title="DatabaseMail02" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail02.jpg" alt="" width="539" height="470" /></a></p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail03.jpg"><img class="aligncenter size-full wp-image-170" title="DatabaseMail03" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail03.jpg" alt="" width="548" height="120" /></a></p>
<p style="text-align: center;">
<div id="attachment_171" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail04.jpg"><img class="size-full wp-image-171  " title="Create a new profile" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail04.jpg" alt="" width="539" height="469" /></a><p class="wp-caption-text">Create a new profile called testProfile</p></div>
<div id="attachment_172" class="wp-caption aligncenter" style="width: 540px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail05.jpg"><img class="size-full wp-image-172 " title="Create smtp account" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail05.jpg" alt="" width="530" height="458" /></a><p class="wp-caption-text">Create testAccount SMTP account that will be associated with the testProfile</p></div>
<p style="text-align: center;">
<div id="attachment_173" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail06.jpg"><img class="size-full wp-image-173  " title="testAccount created" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail06.jpg" alt="" width="539" height="470" /></a><p class="wp-caption-text">testAccount created</p></div>
<p style="text-align: center;">
<div id="attachment_174" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail07.jpg"><img class="size-full wp-image-174  " title="Public Profiles" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail07.jpg" alt="" width="539" height="470" /></a><p class="wp-caption-text">Public Profiles</p></div>
<p style="text-align: center;">
<div id="attachment_175" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail08.jpg"><img class="size-full wp-image-175  " title="Configure System Parameters" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail08.jpg" alt="Configure System Parameters" width="539" height="470" /></a><p class="wp-caption-text">Configure System Parameters</p></div>
<p style="text-align: center;">
<div id="attachment_176" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail09.jpg"><img class="size-full wp-image-176  " title="Summary" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail09.jpg" alt="Summary" width="539" height="470" /></a><p class="wp-caption-text">Summary</p></div>
<p style="text-align: center;">
<div id="attachment_177" class="wp-caption aligncenter" style="width: 549px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail10.jpg"><img class="size-full wp-image-177  " title="Confirmation" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail10.jpg" alt="Confirmation" width="539" height="470" /></a><p class="wp-caption-text">Confirmation</p></div>
<p>Database Mail is now configured and ready for use. Let&#8217;s send a test mail to confirm that it is configured properly.</p>
<p style="text-align: center;">
<div id="attachment_178" class="wp-caption aligncenter" style="width: 563px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail17.jpg"><img class="size-full wp-image-178 " title="Send test email" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail17.jpg" alt="Send test email" width="553" height="506" /></a><p class="wp-caption-text">Send test email</p></div>
<div id="attachment_179" class="wp-caption aligncenter" style="width: 488px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail18.jpg"><img class="size-full wp-image-179" title="Send test email" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail18.jpg" alt="Send test email" width="478" height="290" /></a><p class="wp-caption-text">Send test email</p></div>
<div id="attachment_180" class="wp-caption aligncenter" style="width: 415px"><a href="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail19.jpg"><img class="size-full wp-image-180" title="Email Sent" src="http://www.sqlserverwave.com/wp-content/uploads/2010/06/DatabaseMail19.jpg" alt="Email Sent" width="405" height="284" /></a><p class="wp-caption-text">Check your inbox...</p></div>
<p>Now that we have Database Mail working, we can use the following syntax to send email:</p>
<pre>EXEC [msdb]..[sp_send_dbmail]
@profile_name = 'testProfile',
@recipients = 'To@email.com',
@subject = 'Error Message',
@body = 'Include error message',
@body_format = 'HTML'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/06/15/setting-database-mail-on-sql-server-20052008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set Database Compatibility in SQL Server</title>
		<link>http://www.sqlserverwave.com/2010/01/13/set-database-compatibility-in-sql-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=set-database-compatibility-in-sql-server</link>
		<comments>http://www.sqlserverwave.com/2010/01/13/set-database-compatibility-in-sql-server/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 11:48:34 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=109</guid>
		<description><![CDATA[I have recently upgraded SQL servers from 2000 to 2008. SQL server doesn&#8217;t automatically upgrade the databases to the latest version ie 100. So I had to change the version of each database manually using the following script: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 80 &#124; 90 &#124; 100 } 80 = SQL Server [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently upgraded SQL servers from 2000 to 2008. SQL server doesn&#8217;t automatically upgrade the databases to the latest version ie 100.</p>
<p>So I had to change the version of each database manually using the following script:</p>
<p><span><span id="ctl00_MTCS_main_ctl45_ctl00_ctl00"> </span></span></p>
<pre id="ctl00_MTCS_main_ctl45_ctl00_ctl00_code" style="white-space: pre-wrap; padding-left: 30px;">ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }</pre>
<pre style="padding-left: 30px;"><span>
80 = SQL Server 2000
90 = SQL Server 2005
100 = SQL Server 2008
</span></pre>
<p>To update all databases at once within the SQL instance, the following script might be useful.</p>
<pre style="padding-left: 30px;">select 'ALTER DATABASE ' + name + ' SET COMPATIBILITY_LEVEL = 100'
from sys.databases
where name not in ('master','tempdb','model','msdb')</pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/01/13/set-database-compatibility-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year!</title>
		<link>http://www.sqlserverwave.com/2010/01/01/happy-new-year-2010/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=happy-new-year-2010</link>
		<comments>http://www.sqlserverwave.com/2010/01/01/happy-new-year-2010/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 15:05:00 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=106</guid>
		<description><![CDATA[Best wishes and lots of success for 2010! Cheers.]]></description>
			<content:encoded><![CDATA[<pre><span style="color: #ff6600;">Best wishes and lots of success for 2010!</span></pre>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2010/01/01/happy-new-year-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSIS 2008 Error &#8211; The Microsoft ACE.OLEDB.12.0 provider is not registered on the local machine</title>
		<link>http://www.sqlserverwave.com/2009/12/16/ssis-2008-error-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssis-2008-error-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine</link>
		<comments>http://www.sqlserverwave.com/2009/12/16/ssis-2008-error-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:36:36 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=99</guid>
		<description><![CDATA[I recently upgraded one of my Data Import SSIS 2005 package to 2008. That package ran fine in VS2005. Visual Studio 2008 happily upgraded it to the latest version with the usual Provider upgrade warnings, Provider=SQLNCLI10.1; there was no particular mention of the above error.

The package contains a connection to a 2007 excel file, here is how it looks like...]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded one of my Data Import SSIS 2005 package to 2008. That package ran fine in VS2005. Visual Studio 2008 happily upgraded it to the latest version with the usual Provider upgrade warnings, Provider=SQLNCLI10.1; there was no particular mention of the above error.</p>
<p>The package contains a connection to a 2007 excel file, here is how it looks like:</p>
<div id="attachment_103" class="wp-caption aligncenter" style="width: 427px"><img class="size-full wp-image-103" title="Package" src="http://www.sqlserverwave.com/wp-content/uploads/2009/12/VS2008_001.png" alt="package" width="417" height="345" /><p class="wp-caption-text">package</p></div>
<p>So here is the error popup I got when I clicked the preview button, the Excel Connection Manager was failing to connect to the file:</p>
<div id="attachment_101" class="wp-caption aligncenter" style="width: 594px"><img class="size-full wp-image-101 " title="Microsoft.ACE.OLEDB.12.0 is not registered" src="http://www.sqlserverwave.com/wp-content/uploads/2009/12/VS2008_01.png" alt="Microsoft.ACE.OLEDB.12.0 is not registered" width="584" height="572" /><p class="wp-caption-text">Microsoft.ACE.OLEDB.12.0 is not registered</p></div>
<p>Solution:</p>
<p>Download the latest &#8220;2007 Office System Driver: Data Connectivity Components&#8221;  from <a title="2007 Office System Driver: Data Connectivity Components" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&amp;displaylang=en" target="_blank">here</a> and install it.</p>
<p>After the install, I could happily preview the data in the excel file.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2009/12/16/ssis-2008-error-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL Server Login Transfer &#8211; Password not required</title>
		<link>http://www.sqlserverwave.com/2009/11/30/sql-server-login-transfer-password-not-required/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sql-server-login-transfer-password-not-required</link>
		<comments>http://www.sqlserverwave.com/2009/11/30/sql-server-login-transfer-password-not-required/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 14:25:46 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=95</guid>
		<description><![CDATA[While working on sql server consolidation, I was required to transfer all logins to the new sql server instance. I was worried about not knowing the passwords for a few Windows domain logins. I then realized that passwords are not required when transfering them. All one needs to do is run the scripts available at [...]]]></description>
			<content:encoded><![CDATA[<p>While working on sql server consolidation, I was required to transfer all logins to the new sql server instance. I was worried about not knowing the passwords for a few Windows domain logins. I then realized that passwords are not required when transfering them.</p>
<p>All one needs to do is run the scripts available at the following link:</p>
<p style="text-align: center;">http://support.microsoft.com/kb/918992</p>
<p>The script will generate the script for creating all logins under the sql instance. For example:</p>
<p><span style="color: #808080;"><em>&#8211; Login: Test<br />
CREATE LOGIN [Test_Login] WITH PASSWORD = 0x01006B867DAEEEBC1207A2232FA7B155A7F7670543341FFF012F HASHED, SID = 0x0393B11B9324C04F930A7F951F05EFFF, DEFAULT_DATABASE = [master], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF</em></span></p>
<p>As you can see in the above example, the password is included albeit encrypted.</p>
<p>The good thing is that you are not required to know the password. The bad thing is that you will end up with a new login having a different sid, therefore not matching with the user of the same name in the database. In that case, all you need to do is to run the following script (courtesy of sqlservercentral.com) to find and remap them:</p>
<p><span style="color: #808080;">/**************************ORPHANED USERS****************/<br />
/*** To be run against each db ***/</span></p>
<p><span style="color: #888888;">DECLARE @UserName nvarchar(255)</span></p>
<p><span style="color: #888888;">DECLARE Cursor_OrphanedUser cursor for</span></p>
<p><span style="color: #888888;">SELECT NAME FROM sysusers<br />
WHERE issqluser = 1 and (sid is not null and sid &lt;&gt; 0&#215;01)<br />
and suser_sname(sid) is NOT null ORDER BY name</span></p>
<p><span style="color: #888888;">OPEN Cursor_OrphanedUser</span></p>
<p><span style="color: #888888;">FETCH NEXT FROM Cursor_OrphanedUser INTO @UserName</span></p>
<p><span style="color: #888888;">WHILE (@@fetch_status = 0)</span></p>
<p><span style="color: #888888;">BEGIN</span></p>
<p><span style="color: #888888;">PRINT @UserName + &#8216; Synchronization of Logins in Progress&#8217;</span></p>
<p><span style="color: #888888;">EXEC sp_change_users_login &#8216;Update_one&#8217;, @UserName, @UserName</span></p>
<p><span style="color: #888888;">FETCH NEXT FROM Cursor_OrphanedUser INTO @UserName</span></p>
<p><span style="color: #888888;">END</span></p>
<p><span style="color: #888888;">CLOSE Cursor_OrphanedUser</span></p>
<p><span style="color: #888888;">DEALLOCATE Cursor_OrphanedUser</span></p>
<p><span style="color: #888888;">/************************END ORPHANED USERS********************/</span></p>
<p>Hope you will find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2009/11/30/sql-server-login-transfer-password-not-required/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

