<?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 Backup &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sql-backup/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 11 Jan 2018 19:59:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server Interview: Can we restore the only data file (.mdf file)?</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-interview-can-we-restore-the-only-data-file-mdf-file/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 29 Jan 2018 16:16:49 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[RESTORE FILE ONLY]]></category>
		<category><![CDATA[RESTORE MDF FILE]]></category>
		<category><![CDATA[SQL Backup]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Restore]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7014</guid>

					<description><![CDATA[Sharing another interesting interview question in the category of SQL Server Database Backup and Restore. The question is: Can we restore the only data file (.mdf file) from the backup of SQL Server. The answer is: Yes, we can restore only .mdf file from the backup of SQL Server (.bak file) How? First get the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&amp;linkname=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-interview-can-we-restore-the-only-data-file-mdf-file%2F&#038;title=SQL%20Server%20Interview%3A%20Can%20we%20restore%20the%20only%20data%20file%20%28.mdf%20file%29%3F" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-interview-can-we-restore-the-only-data-file-mdf-file/" data-a2a-title="SQL Server Interview: Can we restore the only data file (.mdf file)?"></a></p><p>Sharing another interesting interview question in the category of SQL Server Database Backup and Restore.</p>
<blockquote><p><strong>The question is:</strong> Can we restore the only data file (.mdf file) from the backup of SQL Server.<br />
<strong>The answer is:</strong> Yes, we can restore only .mdf file from the backup of SQL Server (.bak file)</p></blockquote>
<p><strong>How?</strong></p>
<p><strong>First get the file id from the backup file:</strong><br />
execute below RESTORE and search fileID for the data file (.mdf file)<br />
In my case, fileID =1</p>
<pre class="crayon-plain-tag">RESTORE FILELISTONLY FROM DISK = 'D:\SQL Backup\TestBackup.bak'</pre> </p>
<p><strong>Use fileID for restoring only that file data file:</strong></p>
<pre class="crayon-plain-tag">RESTORE DATABASE TestBackupFROM DISK = 'D:\SQL Backup\TestBackup.bak'
WITH
       FILE = 1,
       RECOVERY</pre> </p>
<p><strong>Now, ready for Next Question:</strong></p>
<blockquote><p><strong>Question is:</strong> Can I bring the database into the ONLINE state without database log files?<br />
<strong>Answer is:</strong> No, not possible</p></blockquote>
<p>If you notice the above RESTORE DATABASE, I wrote RECOVERY which will force SQL Server to rebuild the transaction log and will bring the database in ONLINE state.</p>
<p><strong>All the best!</strong></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
