<?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>tim laqua dot com &#187; RESTORE DATABASE</title>
	<atom:link href="http://timlaqua.com/tag/restore-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://timlaqua.com</link>
	<description>Thoughts and Code from Tim Laqua</description>
	<lastBuildDate>Sun, 09 May 2010 15:25:58 +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>Determining when RESTORE DATABASE command will complete (SQL Server 2008)</title>
		<link>http://timlaqua.com/2009/09/determining-when-restore-database-command-will-complete-sql-server-2008/</link>
		<comments>http://timlaqua.com/2009/09/determining-when-restore-database-command-will-complete-sql-server-2008/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 17:48:22 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[RESTORE DATABASE]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server 2008]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=238</guid>
		<description><![CDATA[Ah, I see you just started restoring that 1TB monster and now everyone wants to know when it's going to be finished, where you're at in the process, etc. Fear not, Microsoft is very good at making up fictional numbers for us to use as rough estimates! I usually add 10-20% on top of these [...]]]></description>
			<content:encoded><![CDATA[<p>Ah, I see you just started restoring that 1TB monster and now everyone wants to know when it's going to be finished, where you're at in the process, etc.  Fear not, Microsoft is very good at making up fictional numbers for us to use as rough estimates!  I usually add 10-20% on top of these estimates just incase the database gremlins wander by to ruin your day again.  Or incase you encounter "storage issues."</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SELECT</span> 
	 percent_complete <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>PercentComplete<span style="color: #808080;">&#93;</span>
	,estimated_completion_time<span style="color: #808080;">/</span><span style="color: #000;">1000.0</span><span style="color: #808080;">/</span><span style="color: #000;">60.0</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>RemainingMinutes<span style="color: #808080;">&#93;</span>
	,total_elapsed_time<span style="color: #808080;">/</span><span style="color: #000;">1000.0</span><span style="color: #808080;">/</span><span style="color: #000;">60.0</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>ElapsedMinutes<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#40;</span>estimated_completion_time<span style="color: #808080;">+</span>total_elapsed_time<span style="color: #808080;">&#41;</span><span style="color: #808080;">/</span><span style="color: #000;">1000.0</span><span style="color: #808080;">/</span><span style="color: #000;">60.0</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>TotalMinutes<span style="color: #808080;">&#93;</span>
	,<span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>MILLISECOND, estimated_completion_time, <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>EstimatedTimeOfCompletion<span style="color: #808080;">&#93;</span>
	,st.<span style="color: #0000FF;">TEXT</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>CommandSQL<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">dm_exec_requests</span> r
	cross apply sys.<span style="color: #202020;">dm_exec_sql_text</span><span style="color: #808080;">&#40;</span>r.<span style="color: #202020;">sql_handle</span><span style="color: #808080;">&#41;</span> st
<span style="color: #0000FF;">WHERE</span> command <span style="color: #808080;">LIKE</span> <span style="color: #FF0000;">'%RESTORE DATABASE%'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/09/determining-when-restore-database-command-will-complete-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
