<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Restore an MSSQL backup to a different database name</title>
	<atom:link href="http://blog.7deeds.com/2008/12/24/restore-an-mssql-backup-to-a-different-database-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.7deeds.com/2008/12/24/restore-an-mssql-backup-to-a-different-database-name/</link>
	<description>Petros Amiridis - A humble programmer's seven noteworthy actions for the community</description>
	<lastBuildDate>Mon, 06 Sep 2010 08:52:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Petros</title>
		<link>http://blog.7deeds.com/2008/12/24/restore-an-mssql-backup-to-a-different-database-name/comment-page-1/#comment-1941</link>
		<dc:creator>Petros</dc:creator>
		<pubDate>Fri, 25 Sep 2009 19:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.7deeds.com/?p=78#comment-1941</guid>
		<description>&lt;a href=&quot;#comment-1940&quot; rel=&quot;nofollow&quot;&gt;@Derek &lt;/a&gt; 

Thanks for commenting. I don&#039;t know why it didn&#039;t work for you without the REPLACE, but I have found the following excerpt:

-----%&lt;------------------
When the REPLACE option is not specified, a safety check occurs (which 
prevents overwriting a different database by accident). The safety check 
ensures that the RESTORE DATABASE statement will not restore the database to 
the current server if:

The database named in the RESTORE statement already exists on the current 
server, and

The database name is different from the database name recorded in the backup 
set.

REPLACE also allows RESTORE to overwrite an existing file which cannot be 
verified as belonging to the database being restored. Normally, RESTORE will 
refuse to overwrite pre-existing files.
-----%&lt;------------------

Maybe something mentioned above was your case.</description>
		<content:encoded><![CDATA[<p><a href="#comment-1940" rel="nofollow">@Derek </a> </p>
<p>Thanks for commenting. I don&#8217;t know why it didn&#8217;t work for you without the REPLACE, but I have found the following excerpt:</p>
<p>&#8212;&#8211;%<&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
When the REPLACE option is not specified, a safety check occurs (which<br />
prevents overwriting a different database by accident). The safety check<br />
ensures that the RESTORE DATABASE statement will not restore the database to<br />
the current server if:</p>
<p>The database named in the RESTORE statement already exists on the current<br />
server, and</p>
<p>The database name is different from the database name recorded in the backup<br />
set.</p>
<p>REPLACE also allows RESTORE to overwrite an existing file which cannot be<br />
verified as belonging to the database being restored. Normally, RESTORE will<br />
refuse to overwrite pre-existing files.<br />
&#8212;&#8211;%<&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Maybe something mentioned above was your case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://blog.7deeds.com/2008/12/24/restore-an-mssql-backup-to-a-different-database-name/comment-page-1/#comment-1940</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Fri, 25 Sep 2009 17:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.7deeds.com/?p=78#comment-1940</guid>
		<description>Why is the replace required here?  What is replace doing?  I&#039;ve been having issues getting a particular DB to restore as a different name, and with a test db I was able to do something like...

restore database testdb from disk = C:\test.bak with recovery,
move &#039;test&#039; to &#039;C:\newlo\test.mdf&#039;,
move &#039;test_Log&#039; to &#039;c:\newlo\test.ldf&#039;
and that worked, but then on this production DB, when I tried the same I kept getting failures until I used replace/go as you did above.</description>
		<content:encoded><![CDATA[<p>Why is the replace required here?  What is replace doing?  I&#8217;ve been having issues getting a particular DB to restore as a different name, and with a test db I was able to do something like&#8230;</p>
<p>restore database testdb from disk = C:\test.bak with recovery,<br />
move &#8216;test&#8217; to &#8216;C:\newlo\test.mdf&#8217;,<br />
move &#8216;test_Log&#8217; to &#8216;c:\newlo\test.ldf&#8217;<br />
and that worked, but then on this production DB, when I tried the same I kept getting failures until I used replace/go as you did above.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
