<?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>Personal website of Dave Hope &#187; SQL Server</title>
	<atom:link href="http://davehope.co.uk/Blog/tag/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://davehope.co.uk</link>
	<description>Open source projects, sysadmin stuff and the home of Product Key Finder</description>
	<lastBuildDate>Fri, 27 Jan 2012 13:47:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Deleting the TFS workspace for a missing account fails (TF50605)</title>
		<link>http://davehope.co.uk/Blog/deleting-the-tfs-workspace-for-a-missing-account-fails-tf50605/</link>
		<comments>http://davehope.co.uk/Blog/deleting-the-tfs-workspace-for-a-missing-account-fails-tf50605/#comments</comments>
		<pubDate>Thu, 13 May 2010 14:24:40 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Team Foundation Server]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=557</guid>
		<description><![CDATA[Having decommissioned a few legacy AD DS domains over the last year or so we&#8217;ve had a few references in TFS to missing accounts. When attempting to delete the workspace you get the following error: TF50605: There was an error looking up the SID for OLD-DOMAIN\CCNETNIGHTLYBUILD. In order to delete the workspace, we need to [...]]]></description>
			<content:encoded><![CDATA[<p>Having decommissioned a few legacy AD DS domains over the last year or so we&#8217;ve had a few references in TFS to missing accounts. When attempting to delete the workspace you get the following error:</p>
<pre>TF50605: There was an error looking up the SID for OLD-DOMAIN\CCNETNIGHTLYBUILD.</pre>
<p>In order to delete the workspace, we need to remap it to a valid user account. Here&#8217;s the process to do just that.<br />
<span id="more-557"></span><br />
Firstly, we should list the workspaces on this computer we&#8217;re having problems with (in this case, BUILDSERVER01).</p>
<pre>C:\&gt;tf workspaces /owner:* /server:http://tfs-server:8080 | findstr BUILDSERVER01
Workspace		Owner				Computer	Comment
----------------------- ------------------------------- --------------- -------------------------------
BUILDSERVER01		saCCNetNightly			BUILDSERVER01	Temporary CruiseControl.NET Wo
BUILDSERVER01		OLD-DOMAIN\CCNETNIGHTLYBUILD	BUILDSERVER01 	Temporary CruiseControl.NET Wo
BUILDSERVER01		saCCNetNightly			BUILDSERVER01
</pre>
<p>We may as well attempt to delete the workspace, though the process is likely to fail as it wont be able to resolve the SID if the domain is no longer available.</p>
<pre>C:\&gt;tf workspace /delete /server:http://tfs-server:8080 BUILDSERVER01;OLD-DOMAIN\CCNETNIGHTLYBUILD
<span style="color: red;">TF50605: There was an error looking up the SID for OLD-DOMAI\CCNETNIGHTLYBUILD.</span></pre>
<p>At this point, we need to open up the <em>TfsVersionControl </em>table and manually point the workspaces to a valid identity. The first stage is to identify the ID of the missing account:</p>
<pre>SELECT IdentityId FROM tfsVersionControl.tbl_Identity WHERE (DisplayName LIKE 'OLD-DOMAIN\CCNETNIGHTLYBUILD')</pre>
<p>Now that we have the ID, we can locate the workspaces the owner has on the server we&#8217;re having problems with.</p>
<pre>SELECT WorkspaceId, OwnerId, WorkspaceName FROM tfsVersionControl.tbl_Workspace WHERE (OwnerId = 311) AND (Computer = 'BUILDSERVER01')</pre>
<p>We should now update the <em>tfsVersionControl.tbl_Workspace</em> table with a valid IdentityId from the <em>tfsVersionControl.tbl_Identity</em> table. Once that&#8217;s done, try the delete command again:</p>
<pre>C:\&gt;tf workspace /delete /server:http://tfs-server:8080 "BUILDSERVER01;Dave Hope"
A deleted workspace cannot be recovered.
Workspace 'BUILDSERVER01;Dave Hope' on server 'http://tfs-server:8080' has 0 pending change(s).
Are you sure you want to delete the workspace? (Yes/No) Yes</pre>
<p>And hey presto, the workspace is gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/deleting-the-tfs-workspace-for-a-missing-account-fails-tf50605/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Security update for SQL Server KB970892 fails to install</title>
		<link>http://davehope.co.uk/Blog/kb970892-fails-to-install/</link>
		<comments>http://davehope.co.uk/Blog/kb970892-fails-to-install/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 08:26:49 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Windows Update]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=465</guid>
		<description><![CDATA[Over the last few days KB970892 has consitently failed to install on our SQL Servers via Windows Update. The following instructions will get it working. Once the update fails to install, you&#8217;ll likely have to reboot as the system will be flagged as pending a reboot. Once rebooted we need to attempt to complete the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few days KB970892 has consitently failed to install on our SQL Servers via Windows Update. The following instructions will get it working.</p>
<p>Once the update fails to install, you&#8217;ll likely have to reboot as the system will be flagged as pending a reboot. Once rebooted we need to attempt to complete the SQL Server installation:</p>
<ol>
<li>Open up <em>Add or Remove Programs</em>, select <em>Microsoft SQL Server 2005</em> and click <em>Change</em></li>
<li>On the <em>Component Selection</em> screen, choose <em>Database Engine</em> under <em>SQL Server 2005 Instances</em> and click <em>Next</em></li>
<li>On the <em>Feature Maintenance</em> screen, choose <em>Database Engine</em> and click <em>Next</em></li>
<li>Go through the setup wizard until the <em>Change or Remove Instance</em> screen. Then click <em>Complete the suspended installation</em>.</li>
<li>Follow through the wizard, if you get a prompt for the files point it at your SQL SP3 installation media and continue.</li>
</ol>
<div class="Message"><img src="/Files/Warning.png" alt="[Warning]" />If you&#8217;re using SQL Server 2005 Express you can extract <em>SQLEXPR32.EXE</em> with the /x switch.</div>
<p><span id="more-465"></span></p>
<p>The installation will likely fail with the following error:</p>
<p><code>SQL Server Setup has encountered the following problem: [Microsoft][SQL Native Client][SQL Server]Password validation  failed. The password does not meet Windows policy requirements because it is too short.. To continue, correct the problem, and then run SQL Server Setup again.</code></p>
<p>Edit <em>C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Upgrade\sqlagent90_msdb_upgrade.sql</em> with notepad or similar.</p>
<p>Change password on line 30683 to something more complex, from:<br />
<code>encryption by password = '<strong>Yukon90_</strong>'</code><br />
To (for example):<br />
<code>encryption by password = '<strong>Yukon90_23423ASDzz}{</strong>'</code></p>
<p>Then further down, change line 30977 to reflect the same value:</p>
<p>From<br />
<code>set @exec_str = N'add signature to ' + @sp + N' by certificate [##MS_AgentSigningCertificate##] with password = ''<strong>Yukon90_</strong>'''</code></p>
<p>To<br />
<code>set @exec_str = N'add signature to ' + @sp + N' by certificate [##MS_AgentSigningCertificate##] with password = ''<strong>Yukon90_23423ASDzz}{</strong>'''</code></p>
<p>Cancel out of setup. Back in <em>Add or Remove Programs</em> choose <em>Change</em> again for <em>Microsoft SQL Server 2005</em> continuing through the wizard as before. This time, you wont get the error and the upgrade will complete.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/kb970892-fails-to-install/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 RTM</title>
		<link>http://davehope.co.uk/Blog/sql-2008-rtm/</link>
		<comments>http://davehope.co.uk/Blog/sql-2008-rtm/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 06:42:04 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=81</guid>
		<description><![CDATA[As Neil points out in his blog, SQL 2008 RTM&#8217;d and is available on Technet / MSDN. Typical, I only setup 2005 Enterprise for SCCM  in my lab environment yesterday. Time to take this for a spin. Keep an eye on Neil&#8217;s blog, he has more SQL2008 goodness planned.]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://neildoesdotnet.blogspot.com/2008/08/sql-server-2008-is-rtm.html">Neil points out in his blog</a>, SQL 2008 RTM&#8217;d and is available on Technet / MSDN. Typical, I only setup 2005 Enterprise for SCCM  in my lab environment yesterday.</p>
<p><img class="size-medium wp-image-83" title="SQL2008 MSDN" src="http://davehope.co.uk/wp-content/uploads/2008/08/sql2008.png" alt="SQL 2008 RTM on MSDN" /></p>
<p>Time to take this for a spin. Keep an eye on<a href="http://neildoesdotnet.blogspot.com/"> Neil&#8217;s blog</a>, he has more SQL2008 goodness planned.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/sql-2008-rtm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying SQL Server with Microsoft Deployment</title>
		<link>http://davehope.co.uk/Blog/deploying-sql-server-with-microsoft-deployment/</link>
		<comments>http://davehope.co.uk/Blog/deploying-sql-server-with-microsoft-deployment/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 13:07:50 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[Microsoft Deployment]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/Blog/deploying-sql-server-with-microsoft-deployment/</guid>
		<description><![CDATA[This guide focuses on VS2005 Express Edition with advanced services, though this applies to any version of SQL2005. The first thing you&#8217;ll need to do is copy the install files to your distribution share via the Deployment Workbench. Be sure to choose a directory structure without spaces as this seems to cause problems during setup. [...]]]></description>
			<content:encoded><![CDATA[<p>This guide focuses on VS2005 Express Edition with advanced services, though this applies to any version of SQL2005.</p>
<p>The first thing you&#8217;ll need to do is copy the install files to your distribution share via the Deployment Workbench. Be sure to choose a directory structure without spaces as this seems to cause problems during setup.</p>
<p>Once you&#8217;ve got your Application folder setup, create a file called &#8216;template.ini&#8217; in the same directory and add the following contents:<br />
<code><br />
[Options]<br />
ADDLOCAL=All<br />
INSTANCENAME=MSSQLSERVER<br />
SQLBROWSERACCOUNT="NT AUTHORITY\NETWORK SERVICE"<br />
SQLACCOUNT="NT AUTHORITY\NETWORK SERVICE"<br />
AGTACCOUNT="NT AUTHORITY\NETWORK SERVICE"<br />
ASACCOUNT="NT AUTHORITY\NETWORK SERVICE"<br />
RSACCOUNT="NT AUTHORITY\NETWORK SERVICE"<br />
SQLBROWSERAUTOSTART=1<br />
SQLAUTOSTART=1<br />
AGTAUTOSTART=0<br />
ASAUTOSTART=0<br />
RSAUTOSTART=0<br />
SECURITYMODE=SQL<br />
SAPWD=9C1_GM3Z@U*+<br />
DISABLENETWORKPROTOCOLS=0<br />
ERRORREPORTING=0<br />
SQMREPORTING=0<br />
</code></p>
<p>That will install all components, and set the local SA password to &#8217;9C1_GM3Z@U*+&#8217;. This needs to be a complex password, or setup will fail.</p>
<p>Once that&#8217;s in place, save the file and use the following quiet install command:</p>
<p><code>setup.exe /qn /settings \\london.nwtraders.msft\Distribution$\Applications\Microsoft_SQL2005_Express\template.ini</code></p>
<p>If you haven&#8217;t already got them added, you&#8217;ll need to add in dependencies for the .Net Framework 2.0 and Windows Installer 3.1</p>
<p>For .Net 2.0 extract dotnetfx.exe, add to your applications distribution folder via the Deployment Workbench and use the following quiet install command <code>install.exe /q</code></p>
<p>For Windows Installer 3.1 (if required) download, add to your applications distribution folder in the normal mannger and use <code>WindowsInstaller-KB893803-v2-x86.exe /quiet</code> as the quiet install command.</p>
<p>You should only need Windows Installer 3.1 if you plan on deploying it to Windows XP, so add a platform restriction (not sure what the official naming is) but choose &#8216;This can run only on the specified client platforms&#8217; but on the &#8216;Details&#8217; tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/deploying-sql-server-with-microsoft-deployment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moving a WSUS 3.0 Database</title>
		<link>http://davehope.co.uk/Blog/moving-a-wsus-database/</link>
		<comments>http://davehope.co.uk/Blog/moving-a-wsus-database/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 08:41:44 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[WSUS]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/Beta/wordpress/Blog/16/</guid>
		<description><![CDATA[Due to seemingly non-existant documentation on moving a WSUS 3.0 database to a new server, I figured i&#8217;d write up my experience. Database configuration is all stored in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\UpdateServices\Server\Setup The keys you&#8217;re interested in are SqlServerName and SqlInstanceIsRemote. Microsoft only officially support Windows authentication, so that&#8217;s what i&#8217;ll cover here. You&#8217;ll be able to connect [...]]]></description>
			<content:encoded><![CDATA[<p>Due to seemingly non-existant documentation on moving a WSUS 3.0 database to a new server, I figured i&#8217;d write up my experience.</p>
<p>Database configuration is all stored in:<br />
<samp>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\UpdateServices\Server\Setup</samp><br />
The keys you&#8217;re interested in are <strong>SqlServerName</strong> and <strong>SqlInstanceIsRemote</strong>. Microsoft only officially support Windows authentication, so that&#8217;s what i&#8217;ll cover here.</p>
<p>You&#8217;ll be able to connect the the Windows Internal Database using Microsoft SQL Server management studio Express (a free download), detach the database and re-attach on your new SQL server.</p>
<p>Once that&#8217;s done, add the computer account of the WSUS server as a database login (e.g. nwtraders\LONDON$) and give it the dbowner role on the SUSDB.</p>
<p>The last step is to set the <strong>SqlServerName</strong> and <strong>SqlIsRemote</strong> values as mentioned earlier. Once done, restart IIS and the UpdateServices service. Job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/moving-a-wsus-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compacting all MSSQL databases</title>
		<link>http://davehope.co.uk/Blog/compacting-all-mssql-databases/</link>
		<comments>http://davehope.co.uk/Blog/compacting-all-mssql-databases/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 12:07:40 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/Blog/compacting-all-mssql-databases/</guid>
		<description><![CDATA[Now that my hangover has just about worn off from a rough night out, I thought i&#8217;d post something useful. Below is a quick and (very) dirty way of clearing down the log and shrinking MSSQL datbases. Something useful for people who want to keep their Windows systems/networks tidy. -- DECLARE STUFF. DECLARE @rowCount int [...]]]></description>
			<content:encoded><![CDATA[<p>Now that my hangover has just about worn off from a rough night out, I thought i&#8217;d post something useful. Below is a quick and (very) dirty way of clearing down the log and shrinking MSSQL datbases. Something useful for people who want to keep their Windows systems/networks tidy.<br />
<code>-- DECLARE STUFF.<br />
DECLARE @rowCount int<br />
DECLARE @rowCurrent int<br />
DECLARE @rowData table (dbID int IDENTITY (1, 1), dbName varchar(50))<br />
DECLARE @dbName varchar(50)<br />
SET @rowCurrent = 0<br />
-- Populate @rowData with list of databases on server.<br />
INSERT INTO @rowData(dbName) SELECT name FROM sysdatabases<br />
-- Number of rows in @rowData.<br />
SELECT @rowCount = COUNT(*) FROM @rowData<br />
-- Itherate through rows.<br />
WHILE @rowCurrent &lt; @rowCount<br />
BEGIN<br />
SELECT @dbName = dbName FROM @rowData WHERE dbID = @rowCurrent<br />
PRINT  @dbName<br />
BACKUP LOG @dbName WITH NO_LOG<br />
DBCC SHRINKDATABASE (@dbName)<br />
SET @rowCurrent = @rowCurrent + 1<br />
END</code><br />
If anyone has some suggestions, feel free to let me know.</p>
<div class="sponsoredWords">The Technology Specialist MCTS certifications help IT professionals to obtain the knowledge of specific technologies. MCTS is the 2nd most important Microsoft’s certification. The candidates are required to pass the <a href="http://www.testking.com/70-529.htm">mcts 70-529</a> Microsoft .NET Framework 2.0, <a href="http://www.testking.com/70-620.htm">mcts 70-620</a> Windows Vista, Configuring, <a href="http://www.testking.com/70-630.htm">mcts 70-630</a> Microsoft Office SharePoint Server 2007,<a href="http://www.testking.com/70-640.htm">mcts 70-640</a> Windows Server 2008 AD and Microsoft <a href="http://www.testking.com/70-642.htm">mcts 70-642</a> exam.</div>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/compacting-all-mssql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

