<?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</title>
	<atom:link href="http://www.sqlserverwave.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlserverwave.com</link>
	<description>Views and Tips on SQL Server</description>
	<lastBuildDate>Thu, 22 Jul 2010 10:31:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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/</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/</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/</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>1</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/</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/</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/</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/</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>1</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/</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>
		<item>
		<title>Error when activating Windows Server 2008</title>
		<link>http://www.sqlserverwave.com/2009/11/05/error-when-activating-windows-server-2008/</link>
		<comments>http://www.sqlserverwave.com/2009/11/05/error-when-activating-windows-server-2008/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:20:17 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=80</guid>
		<description><![CDATA[Having just installed Windows Server 2008 Standard from scratch on a brand new server, I was ready to activate Windows.

When installing Windows, I did provide the registration key when asked. But when going through the activation process, I got an error.

I then decided to change the product key and enter again the same key as I did during the registration process and that solved the problem.

Please find below the steps I went through...]]></description>
			<content:encoded><![CDATA[<p>Having just installed Windows Server 2008 Standard from scratch on a brand new server, I was ready to activate Windows.</p>
<p>When installing Windows, I did provide the registration key when asked. But when going through the activation process, I got an error.</p>
<p>I then decided to change the product key and enter again the same key as I did during the registration process and that solved the problem.</p>
<p>Please find below the steps I went through:</p>
<div id="attachment_81" class="wp-caption aligncenter" style="width: 502px"><img class="size-full wp-image-81  " title="Activate Windows 2008" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows01.png" alt="Activate Windows 2008" width="492" height="378" /><p class="wp-caption-text">Activate Windows 2008</p></div>
<div id="attachment_82" class="wp-caption aligncenter" style="width: 519px"><img class="size-full wp-image-82  " title="Click on Activate Windows online now" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows02.png" alt="Click on Activate Windows online now" width="509" height="431" /><p class="wp-caption-text">Click on Activate Windows online now</p></div>
<div id="attachment_83" class="wp-caption aligncenter" style="width: 519px"><img class="size-full wp-image-83  " title="Activating..." src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows03.png" alt="Activating..." width="509" height="431" /><p class="wp-caption-text">Activating...</p></div>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 520px"><img class="size-full wp-image-84  " title="Windows activation error" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows04.png" alt="Windows activation error" width="510" height="432" /><p class="wp-caption-text">Windows activation error</p></div>
<div id="attachment_85" class="wp-caption aligncenter" style="width: 501px"><img class="size-full wp-image-85   " title="Click on change product key" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows05.png" alt="ActivateWindows05" width="491" height="378" /><p class="wp-caption-text">Click on change product key</p></div>
<div id="attachment_86" class="wp-caption aligncenter" style="width: 575px"><img class="size-full wp-image-86 " title="Enter the product key again" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows06.png" alt="Enter the product key again" width="565" height="479" /><p class="wp-caption-text">Enter the product key again</p></div>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 575px"><img class="size-full wp-image-87 " title="Activating..." src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows07.png" alt="Activating..." width="565" height="478" /><p class="wp-caption-text">Activating...</p></div>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 576px"><img class="size-full wp-image-88 " title="Activation successful" src="http://www.sqlserverwave.com/wp-content/uploads/2009/11/ActivateWindows08.png" alt="Activation successful" width="566" height="478" /><p class="wp-caption-text">Activation successful</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2009/11/05/error-when-activating-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling remote access to sql server 2008 on a windows 2008 server</title>
		<link>http://www.sqlserverwave.com/2009/10/29/enabling-remote-access-to-sql-server-2008-on-a-windows-2008-server/</link>
		<comments>http://www.sqlserverwave.com/2009/10/29/enabling-remote-access-to-sql-server-2008-on-a-windows-2008-server/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 10:15:14 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://www.sqlserverwave.com/?p=36</guid>
		<description><![CDATA[I recently installed SQL Server 2008 on a brand new server (HP Proliant GL360 G6) with Windows Server 2008 Standard on it . It all went fine and I could start Sql Server Studion Management tool right after the installation. It is only when I was trying to access that server remotely that I got into [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed SQL Server 2008 on a brand new server (HP Proliant GL360 G6) with Windows Server 2008 Standard on it . It all went fine and I could start Sql Server Studion Management tool right after the installation.</p>
<p>It is only when I was trying to access that server remotely that I got into problems! It just couldn&#8217;t connect to the sql server and was getting the folowing error:</p>
<div class="mceTemp mceIEcenter">
<div id="attachment_76" class="wp-caption aligncenter" style="width: 507px"><img class="size-full wp-image-76 " title="SQL Server 2008 Remote Access error" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_003.png" alt="SQL Server 2008 Remote Access error" width="497" height="161" /><p class="wp-caption-text">SQL Server 2008 Remote Access error</p></div>
</div>
<p>I tried accessing via IP address as well but that wasn&#8217;t successfull either. A look into the firewall was then in order. By default in Windows 2008 Server every ports, except a very few ones, are disabled. If you are using the default port for your sql engine, the port number 1433 needs to be enabled. I have also enabled port number 1434 for SQL Browser service. The following screen shots shows the step needed to allow remote access to sql server 2008 on a windows 2008 server.</p>
<p>First of all, you need to ensure that Remote Connections are allowed within SQL Server configuration:</p>
<div id="attachment_38" class="wp-caption aligncenter" style="width: 356px"><img class="size-full wp-image-38" title="Right click on the registered server and choose Properties" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_001.png" alt="Right click on the registered server and choose Properties" width="346" height="524" /><p class="wp-caption-text">Right click on the registered server and choose Properties</p></div>
<div id="attachment_78" class="wp-caption aligncenter" style="width: 517px"><img class="size-full wp-image-78  " title="Check Allow remote connections box" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_0021.png" alt="Check Allow remote connections box" width="507" height="457" /><p class="wp-caption-text">Check Allow remote connections box</p></div>
<p>Once this is done, you can start looking into the Firewall setting.</p>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 526px"><img class="size-full wp-image-40 " title="This is how to access Windows Firewall setting on Windows Server 2008" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_01.png" alt="This is how to access Windows Firewall setting on Windows Server 2008" width="516" height="485" /><p class="wp-caption-text">This is how to access Windows Firewall setting on Windows Server 2008</p></div>
<div id="attachment_47" class="wp-caption aligncenter" style="width: 556px"><img class="size-full wp-image-47 " title="Firewall main screen" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_022.png" alt="Firewall main screen" width="546" height="397" /><p class="wp-caption-text">Firewall main screen</p></div>
<div id="attachment_51" class="wp-caption aligncenter" style="width: 556px"><img class="size-full wp-image-51  " title="Click on Inbound Rules" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_03.png" alt="Click on Inbound Rules" width="546" height="396" /><p class="wp-caption-text">Click on Inbound Rules</p></div>
<div id="attachment_52" class="wp-caption aligncenter" style="width: 556px"><img class="size-full wp-image-52  " title="Righ click on Inbound Rules and choose Add..." src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_04.png" alt="Righ click on Inbound Rules and choose Add..." width="546" height="397" /><p class="wp-caption-text">Righ click on Inbound Rules and choose Add...</p></div>
<div class="mceTemp mceIEcenter">
<div id="attachment_57" class="wp-caption aligncenter" style="width: 587px"><img class="size-full wp-image-57 " title="Choose Port" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_061.png" alt="Choose Port" width="577" height="461" /><p class="wp-caption-text">Choose Port</p></div>
</div>
<div id="attachment_56" class="wp-caption aligncenter" style="width: 585px"><img class="size-full wp-image-56 " title="Choose TCP and type the Port number" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_07.png" alt="Choose TCP and type the Port number" width="575" height="460" /><p class="wp-caption-text">Choose TCP and type the Port number</p></div>
<div id="attachment_58" class="wp-caption aligncenter" style="width: 585px"><img class="size-full wp-image-58 " title="Choose Allow the connection" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_08.png" alt="Choose Allow the connection" width="575" height="460" /><p class="wp-caption-text">Choose Allow the connection</p></div>
<div id="attachment_60" class="wp-caption aligncenter" style="width: 587px"><img class="size-full wp-image-60 " title="Uncheck if further restrictions apply in your environment" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_091.png" alt="Uncheck if further restrictions apply in your environment" width="577" height="462" /><p class="wp-caption-text">Uncheck if further restrictions apply in your environment</p></div>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 586px"><img class="size-full wp-image-63 " title="Name it accordingly" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_101.png" alt="Name it accordingly" width="576" height="460" /><p class="wp-caption-text">Name it accordingly</p></div>
<div id="attachment_67" class="wp-caption aligncenter" style="width: 548px"><img class="size-full wp-image-67   " title="That's it!" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_16.png" alt="That's it!" width="538" height="428" /><p class="wp-caption-text">That&#39;s it!</p></div>
<p>Now, if you also want to set the SQL Browser service port, you just need to choose UDP instead of TCP.</p>
<div id="attachment_68" class="wp-caption aligncenter" style="width: 586px"><img class="size-full wp-image-68 " title="SQL Browser service - UDP Port 1434" src="http://www.sqlserverwave.com/wp-content/uploads/2009/10/Firewall_12.png" alt="SQL Browser service - UDP Port 1434" width="576" height="460" /><p class="wp-caption-text">SQL Browser service - UDP Port 1434</p></div>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqlserverwave.com/2009/10/29/enabling-remote-access-to-sql-server-2008-on-a-windows-2008-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
