<?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>mylifeinaminute.com &#187; SQL Server</title>
	<atom:link href="http://www.mylifeinaminute.com/tag/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mylifeinaminute.com</link>
	<description>You can learn a lot in a minute</description>
	<lastBuildDate>Wed, 18 Jan 2012 02:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Randomize Text in SQL</title>
		<link>http://www.mylifeinaminute.com/2010/11/08/randomize-text-in-sql/</link>
		<comments>http://www.mylifeinaminute.com/2010/11/08/randomize-text-in-sql/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 03:40:10 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=581</guid>
		<description><![CDATA[A quick stored procedure to obfuscate existing text in a SQL field (and no, you can&#8217;t use a UDF&#8230; darn rand() function).]]></description>
			<content:encoded><![CDATA[<p>A quick stored procedure to obfuscate existing text in a SQL field (and no, you can&#8217;t use a UDF&#8230; darn rand() function).</p>
<pre class="brush: sql; title: ; notranslate">
ALTER PROCEDURE [dbo].[GenerateObfuscatedText]
	-- Add the parameters for the stored procedure here
	@inputText nvarchar(max) = '',
	@outputText nvarchar(max) output
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	declare @intcounter int;
	declare @intstringlength int;
	declare @mynewstring nvarchar(max);

	select @intstringlength = len(@inputText);

	set @outputText = '';
	set @intcounter = 0;

	while @intcounter &lt;= @intstringlength
	begin
		if ascii(substring(@inputText, @intcounter, 1)) between 65 and 90
			set @outputText = @outputText + nchar((cast(rand()*1000 as
int)%26)+65); -- A-Z
		else if ascii(substring(@inputText, @intcounter, 1)) between 97 and 122
			set @outputText = @outputText + nchar((cast(rand()*1000 as
int)%26)+97); -- a-z
		else
			set @outputText = @outputText + substring(@inputText, @intcounter, 1);

		set @intcounter = @intcounter + 1;
	end

	select @outputText;
END
</pre>
<p><map name='google_ad_map_581_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/581?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_581_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=581&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2010%2F11%2F08%2Frandomize-text-in-sql%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2010/11/08/randomize-text-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;TRUNCATE_ONLY&#8217; IS not a recognized BACKUP OPTION.</title>
		<link>http://www.mylifeinaminute.com/2010/05/12/truncate_only-is-not-a-recognized-backup-option/</link>
		<comments>http://www.mylifeinaminute.com/2010/05/12/truncate_only-is-not-a-recognized-backup-option/#comments</comments>
		<pubDate>Wed, 12 May 2010 13:35:30 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[TechNet]]></category>
		<category><![CDATA[Error Message]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=435</guid>
		<description><![CDATA[Microsoft has completely removed the BACKUP LOG WITH TRUNCATE_ONLY capability completely from SQL Server 2008. If you try to attempt to execute the following command: This is the result: To circumvent this error in a DEVELOPMENT environment (not Production), use the following commands: One should never execute the above commands in a Production environment unless [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has completely removed the BACKUP LOG WITH TRUNCATE_ONLY capability completely from SQL Server 2008.  If you try to attempt to execute the following command:</p>
<pre class="brush: sql; title: ; notranslate">
BACKUP LOG AdventureWorks WITH TRUNCATE_ONLY
</pre>
<p>This is the result:</p>
<pre class="brush: sql; title: ; notranslate">
'TRUNCATE_ONLY' IS not a recognized BACKUP OPTION.
</pre>
<p>To circumvent this error in a <strong>DEVELOPMENT</strong> environment (not Production), use the following commands:</p>
<pre class="brush: sql; title: ; notranslate">
USE AdventureWorks
GO
ALTER DATABASE AdventureWorks SET RECOVERY SIMPLE
DBCC SHRINKFILE(N'AdventureWorks_log', 1)
ALTER DATABASE AdventureWorks SET RECOVERY FULL
GO
</pre>
<p>One should never execute the above commands in a Production environment unless you wish to lose all of your prior transaction log backups and the ability to restore to a given point in time based on those backups. </p>
<h4>Reference</h4>
<ul>
<li><a title="DBCC SHRINKFILE" href="http://technet.microsoft.com/en-us/library/ms189493.aspx">DBCC SHRINKFILE</a> (Technet)</li>
</ul>
<p><map name='google_ad_map_435_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/435?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_435_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=435&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2010%2F05%2F12%2Ftruncate_only-is-not-a-recognized-backup-option%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2010/05/12/truncate_only-is-not-a-recognized-backup-option/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exception: The content type is in use</title>
		<link>http://www.mylifeinaminute.com/2009/03/17/exception-the-content-type-is-in-use/</link>
		<comments>http://www.mylifeinaminute.com/2009/03/17/exception-the-content-type-is-in-use/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 13:53:14 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Sharepoint Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Windows SharePoint Services]]></category>
		<category><![CDATA[Content Types]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=344</guid>
		<description><![CDATA[I&#8217;ve found that working with InfoPath is becoming more and more of a chore.  A form I&#8217;ve been working on has had its promoted columns changed a number of times (Side note: I would just love to have a defined specification). Today when I attempted to completely retract my form (inlcuding manually deleting the content [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found that working with InfoPath is becoming more and more of a chore.  A form I&#8217;ve been working on has had its promoted columns changed a number of times (Side note: I would just love to have a defined specification).</p>
<p>Today when I attempted to completely retract my form (inlcuding manually deleting the content type associated with the form), I was presented with the always helpful error &#8220;<span style="color: red;"><em>The content type is in use</em></span>&#8220;.  This is by far one of the more helpful errors you will ever see from SharePoint.  Unfortunately it isn&#8217;t clear how to discover where the content type is actually in use.  A quick trip to the content database for the site collection you are working in can show us:</p>
<pre>
<pre class="brush: sql; title: ; notranslate">
DECLARE @ContentTypeName nvarchar(128)

SET @ContentTypeName='Content Type Name Here'

SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title],
	ct2.*
FROM ContentTypes ct1
	JOIN ContentTypes ct2 ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId
	LEFT OUTER JOIN dbo.ContentTypeUsage ctu ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId
	LEFT OUTER JOIN dbo.AllLists al ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId
	LEFT OUTER JOIN dbo.Webs w ON al.tp_WebId = w.Id WHERE ct1.ResourceDir=@ContentTypeName
</pre>
</pre>
<p>[Credit to <a href="http://social.msdn.microsoft.com/en-US/profile/?user=Curtis%20Ruppe%20_MicroStaff%20IT_&#038;referrer=http%3A//social.msdn.microsoft.com/Forums/en-US/sharepointadmin/thread/0a558f4f-cd1e-4432-85bb-caaa3a3b57ae/#sort=recent&#038;page=0&#038;filter=allcontent" target="_blank">Curtis Ruppe</a>]</p>
<p>Once we know where the content type is in use, deleting it through the GUI is a trivial matter.</p>
<p><map name='google_ad_map_344_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/344?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_344_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=344&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2009%2F03%2F17%2Fexception-the-content-type-is-in-use%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2009/03/17/exception-the-content-type-is-in-use/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Migrating a Content database from a RTM farm to a SP1 farm in SharePoint</title>
		<link>http://www.mylifeinaminute.com/2008/12/10/migrating-a-content-database-from-a-rtm-farm-to-a-sp1-farm-in-sharepoint/</link>
		<comments>http://www.mylifeinaminute.com/2008/12/10/migrating-a-content-database-from-a-rtm-farm-to-a-sp1-farm-in-sharepoint/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 16:23:06 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Sharepoint Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Windows SharePoint Services]]></category>
		<category><![CDATA[content database]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[moss service pack]]></category>
		<category><![CDATA[service pack]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[sql server 2000]]></category>
		<category><![CDATA[stsadm]]></category>
		<category><![CDATA[upgrade content database]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=232</guid>
		<description><![CDATA[Recently, we came across a need to migrate an existing (SharePoint 2007) RTM content database to a new farm, which had SP1 pre-installed.  After taking a full backup of the existing database (through SQL Server), the backup was restored in the new farm. Note: I should also mention that the database was migrating from SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, we came across a need to migrate an existing (<a title="SharePoint" href="/tag/sharepoint/">SharePoint</a> <a title="SharePoint 2007" href="/tag/moss-2007/">2007</a>) RTM content database to a new farm, which had SP1 pre-installed.  After taking a full backup of the existing database (through <a title="SQL Server" href="/tag/sql-server/">SQL Server</a>), the backup was restored in the new farm.</p>
<p><strong><em>Note:</em></strong> I should also mention that the database was migrating from SQL Server 2000 to SQL Server 2005.</p>
<p>After resetting the SharePoint servers, browsing to the site in question brought the following error:</p>
<blockquote><p><span style="color: #ff0000;">Server error: http://go.microsoft.com/fwlink?LinkID=96177</span></p></blockquote>
<p>At this point, we detached the content database in question (Central Administration » Application Management »  Content databases).  Once the database was successfully detached from the farm, it was reattached using the following STSADM command:</p>
<blockquote><p>stsadm -o addcontentdb -url ‹URL›  -databasename ‹DBNAME›</p></blockquote>
<p>Reattaching the content database with the above command completely successfully, and as an added benefit performed an inplace upgrade, bringing the database schema up to SP1.  This might prove to be a helping hand when it comes to migrating to MOSS 2007 SP1 if your wish is to start with a new farm, but retain your original content.</p>
<p><map name='google_ad_map_232_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/232?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_232_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=232&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2008%2F12%2F10%2Fmigrating-a-content-database-from-a-rtm-farm-to-a-sp1-farm-in-sharepoint%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2008/12/10/migrating-a-content-database-from-a-rtm-farm-to-a-sp1-farm-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Web Platform Installer</title>
		<link>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/</link>
		<comments>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 15:24:21 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Internet Information Services]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Platform Installer]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=223</guid>
		<description><![CDATA[Microsoft has just released the Web Platform Installer (RC1).   What is the Web Platform Installer you ask?  From Microsoft: &#8220;The Web Platform Installer (Web PI) is a simple tool that installs Microsoft&#8217;s entire Web Platform, including IIS7, Visual Web Developer 2008 Express Edition, SQL Server 2008 Express Edition and the .NET Framework. Using the Web [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Microsoft" href="/tag/microsoft/">Microsoft</a> has just released the <a title="Microsoft Web Platform Installer (RC1)" href="http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx">Web Platform Installer (RC1)</a>.   What is the <a title="Microsoft Web Platform Installer (RC1)" href="http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx">Web Platform Installer</a> you ask?  From <a title="Microsoft" href="/tag/microsoft/">Microsoft</a>:</p>
<blockquote><p>&#8220;The Web Platform Installer (Web PI) is a simple tool that installs Microsoft&#8217;s entire Web Platform, including IIS7, Visual Web Developer 2008 Express Edition, SQL Server 2008 Express Edition and the .NET Framework. Using the Web Platform Installer’s user interface, you can choose to install either specific products or the entire Microsoft Web Platform onto your computer. The Web PI also helps keep your products up to date by always offering the latest additions to the Web Platform.&#8221;</p></blockquote>
<p>The Web PI certainly looks promising as a quick ramp-up when setting up a development environment (or even a one-off server environment).</p>
<p><map name='google_ad_map_223_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/223?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_223_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=223&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2008%2F12%2F01%2Fmicrosoft-web-platform-installer%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When you drop the default database of the farm Service Account&#8230;</title>
		<link>http://www.mylifeinaminute.com/2008/11/14/when-you-drop-the-default-database-of-the-farm-service-account/</link>
		<comments>http://www.mylifeinaminute.com/2008/11/14/when-you-drop-the-default-database-of-the-farm-service-account/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 21:06:51 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Sharepoint Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Windows SharePoint Services]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[wss 3.0]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=178</guid>
		<description><![CDATA[When cleaning up a number of older databases in a QA/Staging environment (databases dating back to 2003), we managed to delete the default database for the SharePoint database system account. After deleting the database, the user will longer be able to perform actions on the SQL instance (login, view databases, etc.) when logging on through [...]]]></description>
			<content:encoded><![CDATA[<p>When cleaning up a number of older databases in a QA/Staging environment (databases dating back to 2003), we managed to delete the default database for the SharePoint database system account.  After deleting the database, the user will longer be able to perform actions on the SQL instance (login, view databases, etc.) when logging on through Management Studio.  To fix this error, log on to your SQL server as another administrative user (like the &#8220;sa&#8221; account), and execute the following:</p>
<pre>
<pre class="brush: sql; title: ; notranslate">
sp_defaultdb 'SQLSERVER\dbuser', &lt;DEFAULT DB&gt;
</pre>
</pre>
<p>Replacing <strong><DEFAULT DB></strong> with the new default database name.</p>
<p><map name='google_ad_map_178_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/178?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_178_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=178&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2008%2F11%2F14%2Fwhen-you-drop-the-default-database-of-the-farm-service-account%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2008/11/14/when-you-drop-the-default-database-of-the-farm-service-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.mylifeinaminute.com @ 2012-02-05 08:14:58 by W3 Total Cache -->
