<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SQL Server Journey with SQL Authority &#187; SQL Data Storage</title>
	<atom:link href="http://blog.sqlauthority.com/category/sql-data-storage/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:09:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.sqlauthority.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/08e35387c05b61340e885b1763a69d9f?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>SQL Server Journey with SQL Authority &#187; SQL Data Storage</title>
		<link>http://blog.sqlauthority.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.sqlauthority.com/osd.xml" title="SQL Server Journey with SQL Authority" />
	<atom:link rel='hub' href='http://blog.sqlauthority.com/?pushpress=hub'/>
		<item>
		<title>SQL SERVER &#8211; FIX &#8211; ERROR : Msg 3201, Level 16 Cannot open backup device . Operating system error 5(Access is denied.)</title>
		<link>http://blog.sqlauthority.com/2011/04/13/sql-server-fix-error-msg-3201-level-16-cannot-open-backup-device-operating-system-error-5access-is-denied/</link>
		<comments>http://blog.sqlauthority.com/2011/04/13/sql-server-fix-error-msg-3201-level-16-cannot-open-backup-device-operating-system-error-5access-is-denied/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 01:30:57 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[PostADay]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=12605</guid>
		<description><![CDATA[Recently I formatted my computer and installed fresh SQL Server in it. I installed AdventureWorks database in my database. Once done I wanted to run few test scripts on my database. Just like every DBA, I decided to take backup of my database &#8211; this way I can restore it back to attain original database [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=12605&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Recently I formatted my computer and installed fresh SQL Server in it. I installed AdventureWorks database in my database. Once done I wanted to run few test scripts on my database. Just like every DBA, I decided to take backup of my database &#8211; this way I can restore it back to attain original database state. As soon as I ran the backup command I ended up with following error. This error is due to permissions issue on the local disk and user account which is running SQL Server.</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Msg 3201, Level 16, State 1, Line 1</span><br />
<span style="color:#ff0000;"> Cannot open backup device &#8216;C:\AdventureWorks.bak&#8217;. Operating system error 5(Access is denied.).</span></p>
<p style="text-align:justify;"><strong>Fix/Resolution/Workaround:</strong></p>
<p style="text-align:justify;">I checked which user account my SQL Server services are running.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/NetworkError1.jpg" alt="" width="405" height="448" /></p>
<p style="text-align:justify;">I gave full permission to that account to get read of the error.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/NetworkError2.jpg" alt="" width="377" height="456" /></p>
<p style="text-align:justify;">NOTE: This whole experience was done on the my personal machine and not on production server. Please check with your network administrator for permission on production server.</p>
<p style="text-align:justify;">Reference:<strong> Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-backup-and-restore/'>SQL Backup and Restore</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-error-messages/'>SQL Error Messages</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/12605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/12605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/12605/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=12605&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2011/04/13/sql-server-fix-error-msg-3201-level-16-cannot-open-backup-device-operating-system-error-5access-is-denied/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/NetworkError1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/NetworkError2.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; 32 Bit &#8211; 64 Bit &#8211; HTML5 &#8211; Database Backup Restore</title>
		<link>http://blog.sqlauthority.com/2011/03/27/sql-server-32-bit-64-bit-html5-database-backup-restore/</link>
		<comments>http://blog.sqlauthority.com/2011/03/27/sql-server-32-bit-64-bit-html5-database-backup-restore/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 01:30:13 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[PostADay]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Humor]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=12329</guid>
		<description><![CDATA[During TechEd India I was attending HTML5 session along with regular Database sessions. Couple of attendees were discussing database there and I find the incidence very interesting. Note: Please take the whole discussion keeping humor as primary. There is no incident to disrespect anybody. Attendee1: I wonder if this HTML5 works on 64-bit machine &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=12329&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">During TechEd India I was attending HTML5 session along with regular Database sessions. Couple of attendees were discussing database there and I find the incidence very interesting.</p>
<p style="text-align:justify;">Note: Please take the whole discussion keeping humor as primary. There is no incident to disrespect anybody.</p>
<p style="text-align:justify;">Attendee1: I wonder if this HTML5 works on 64-bit machine &#8211; hopefully they support it?<br />
Attendee2: I think they will create HTML5 such a way that it will work on 32-bit and 64-bit machine.<br />
Attendee1: Yeah they should.<br />
Attendee2: I wonder how much work the product team developer have to do &#8211; they have to create 32-bit browser which supports 32-bit and 64-bit HTML5 and on 64-bit browser support for 32-bit and 64-bit HTML5.</p>
<p style="text-align:justify;">I could not stop myself from speaking as I was listening this loud conversation sitting behind them.</p>
<p style="text-align:justify;">Pinal: Hey, I think HTML5 is markup language and it will work on 32-bit and 64-bit browser without any special requirement. Just like earlier version of HTML there is no different coding for 32-bit or 64-bit browser.</p>
<p style="text-align:justify;">Attendee1: Really!<br />
Attednee2: Are you web developer too?<br />
Pinal: Yes, I am web developer but I love to work on database technology.<br />
Attendee1: Are you sure regarding there is no specific HTML for 64-bit machine?<br />
Attendee2: Yeah. Tell me. Does your database back up from 64-bit work on 32-bit machine?<br />
Pinal: Yes. You can restore database backup from 64-bit to 32-bit machine without issue, or vice-a-versa. Database backup is just a file and it can work independent of the version. Just like TXT file or JPG file.</p>
<p style="text-align:justify;">Both of the attendees got very quite. Finally they whispered.</p>
<p style="text-align:justify;">Attendee1: (Whispering) Let us try out what he is suggesting.<br />
Attendee2: (Nodding Yes)<br />
Pinal: (Looking at them with Wide Open Eyes).</p>
<p style="text-align:justify;">Reference:<strong> Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-humor/'>SQL Humor</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/12329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/12329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/12329/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=12329&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2011/03/27/sql-server-32-bit-64-bit-html5-database-backup-restore/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER – Computed Column – PERSISTED and Storage – Part 2</title>
		<link>http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/</link>
		<comments>http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 01:30:44 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=9868</guid>
		<description><![CDATA[I am really enjoying writing about computed column and its effect in terms of storage. Before I go on with this topic, I suggest you read the earlier articles about computed column to get the complete context. This is the list of the all the articles in the series of computed column. SQL SERVER – [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=9868&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I am really enjoying writing about <strong>computed column</strong> and its effect in terms of storage. Before I go on with this topic, I suggest you read the earlier articles about computed column to get the complete context.</p>
<p style="text-align:justify;">This is the list of the all the articles in the series of computed column.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/07/27/sql-server-computed-column-persisted-and-storage/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Storage</strong></a></p>
<p style="text-align:justify;">This article talks about how computed columns are created and why they take more storage space than before.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/03/sql-server-computed-column-persisted-and%C2%A0performance/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Performance</strong></a></p>
<p style="text-align:justify;">This article talks about how PERSISTED columns give better performance than non-persisted columns.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/04/sql-server-computed-column-persisted-and-performance-part-2/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Performance – Part 2</strong></a></p>
<p style="text-align:justify;">This article talks about how non-persisted columns give better performance than PERSISTED columns.</p>
<p style="text-align:justify;"><a title="Permanent Link to SQL SERVER – Computed Column and Performance – Part 3" href="http://blog.sqlauthority.com/2010/08/13/sql-server-computed-column-and-performance-part-3/"><strong>SQL SERVER – Computed Column and Performance – Part 3</strong></a></p>
<p style="text-align:justify;">This article talks about how Index improves the performance of Computed Columns.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Storage – Part 2</strong></a></p>
<p style="text-align:justify;">This article talks about how creating index on computed column does not grow the row length of table.</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/08/22/sql-server-computed-columns-index-and-performance/" target="_blank">SQL SERVER – Computed Columns – Index and Performance</a></strong></p>
<p style="text-align:justify;">This article summarized all the articles related to computed columns.</p>
<p style="text-align:justify;">This article actually originates from the questions asked by one of the smartest attendees I have ever met in training a few weeks ago. He really impressed me with these good questions. He asked me this: “<strong>if we create the index on computed column, does it increase the data size of the original table? In other words, does the computed column become persisted if we create an index on it?</strong>&#8220;</p>
<p style="text-align:justify;">This is a great question and the answer is rather very simple: <strong>No</strong>. It does not increase the data size of the original table as well as it does not turn the column into persisted. When we create an index on the column of the table, there is an additional space occupied by that index. Let us run the following code and understand this behavior.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">tempdb<br />
GO<br />
</span><span style="color:green;">-- Create Table<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">CompCol </span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">,<br />
</span><span style="color:black;">FirstName </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">),<br />
</span><span style="color:black;">LastName </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">))<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Insert One Hundred Thousand Records<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">CompCol </span><span style="color:gray;">(</span><span style="color:black;">ID</span><span style="color:gray;">,</span><span style="color:black;">FirstName</span><span style="color:gray;">,</span><span style="color:black;">LastName</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT TOP </span><span style="color:black;">100000 ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">a.name</span><span style="color:gray;">) </span><span style="color:black;">RowID</span><span style="color:gray;">,<br />
</span><span style="color:red;">'Bob'</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">CASE </span><span style="color:blue;">WHEN </span><span style="color:black;">ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">a.name</span><span style="color:gray;">)%</span><span style="color:black;">2 </span><span style="color:blue;">= </span><span style="color:black;">1 </span><span style="color:blue;">THEN </span><span style="color:red;">'Smith'<br />
</span><span style="color:blue;">ELSE </span><span style="color:red;">'Brown' </span><span style="color:blue;">END<br />
FROM </span><span style="color:black;">sys.all_objects a<br />
</span><span style="color:gray;">CROSS </span><span style="color:blue;">JOIN </span><span style="color:black;">sys.all_objects b<br />
GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'CompCol'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Add Computed Column<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">dbo.CompCol </span><span style="color:blue;">ADD<br />
</span><span style="color:black;">FullName </span><span style="color:blue;">AS </span><span style="color:gray;">(</span><span style="color:black;">FirstName</span><span style="color:gray;">+</span><span style="color:red;">' '</span><span style="color:gray;">+</span><span style="color:black;">LastName</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'CompCol'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Create non clustered index on Computed Column<br />
</span><span style="color:blue;">CREATE NONCLUSTERED INDEX </span><span style="color:black;">IX_CompCol_FullName<br />
</span><span style="color:blue;">ON </span><span style="color:black;">dbo.CompCol </span><span style="color:gray;">(</span><span style="color:black;">FullName</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'CompCol'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Add Computed Column PERSISTED<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">dbo.CompCol </span><span style="color:blue;">ADD<br />
</span><span style="color:black;">FullName_P </span><span style="color:blue;">AS </span><span style="color:gray;">(</span><span style="color:black;">FirstName</span><span style="color:gray;">+</span><span style="color:red;">' '</span><span style="color:gray;">+</span><span style="color:black;">LastName</span><span style="color:gray;">) </span><span style="color:black;">PERSISTED<br />
GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'CompCol'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Clean up Database<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:black;">CompCol<br />
GO<br />
</span></code></p>
<p style="text-align:justify;">Here we have done the following efforts:</p>
<ol style="text-align:justify;">
<li>Basic table and measured the used      space</li>
<li>Computed column and measured the used      space</li>
<li>Index on computed column and      measured the used space</li>
<li>Table and measured the used space</li>
</ol>
<p style="text-align:justify;">Now let us observe the resultset.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/persisted5.jpg" alt="" width="448" height="396" /></p>
<p style="text-align:justify;">Taking a look at the result, it is very clear that columns made persisted only takes additional spaces. On the other hand, when an index is created, it does not increase the data size of the table; rather, the index created just uses up the unused space in the table.</p>
<p style="text-align:justify;">Let me know your opinion about this series.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-optimization/'>SQL Optimization</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/9868/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/9868/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/9868/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=9868&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/persisted5.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Computed Column &#8211; PERSISTED and Storage</title>
		<link>http://blog.sqlauthority.com/2010/07/27/sql-server-computed-column-persisted-and-storage/</link>
		<comments>http://blog.sqlauthority.com/2010/07/27/sql-server-computed-column-persisted-and-storage/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 01:30:13 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Computed Column]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=9663</guid>
		<description><![CDATA[This is the list of the all the articles in the series of computed column. SQL SERVER – Computed Column – PERSISTED and Storage This article talks about how computed columns are created and why they take more storage space than before. SQL SERVER – Computed Column – PERSISTED and Performance This article talks about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=9663&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">This is the list of the all the articles in the series of computed column.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/07/27/sql-server-computed-column-persisted-and-storage/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Storage</strong></a></p>
<p style="text-align:justify;">This article talks about how computed columns are created and why they take more storage space than before.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/03/sql-server-computed-column-persisted-and%C2%A0performance/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Performance</strong></a></p>
<p style="text-align:justify;">This article talks about how PERSISTED columns give better performance than non-persisted columns.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/04/sql-server-computed-column-persisted-and-performance-part-2/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Performance – Part 2</strong></a></p>
<p style="text-align:justify;">This article talks about how non-persisted columns give better performance than PERSISTED columns.</p>
<p style="text-align:justify;"><a title="Permanent Link to SQL SERVER – Computed Column and Performance – Part 3" href="http://blog.sqlauthority.com/2010/08/13/sql-server-computed-column-and-performance-part-3/"><strong>SQL SERVER – Computed Column and Performance – Part 3</strong></a></p>
<p style="text-align:justify;">This article talks about how Index improves the performance of Computed Columns.</p>
<p style="text-align:justify;"><a href="http://blog.sqlauthority.com/2010/08/21/sql-server-computed-column-persisted-and-storage-part-2/" target="_blank"><strong>SQL SERVER – Computed Column – PERSISTED and Storage – Part 2</strong></a></p>
<p style="text-align:justify;">This article talks about how creating index on computed column does not grow the row length of table.</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/08/22/sql-server-computed-columns-index-and-performance/" target="_blank">SQL SERVER – Computed Columns – Index and Performance</a></strong></p>
<p style="text-align:justify;">This article summarized all the articles related to computed columns.</p>
<p style="text-align:justify;">Every time I go for SQL Server Training or Consultation, I always learn something from my attendees. Sometime I even learn that a simple concept which we think is easy and whole world knows, many times very few knows about the same. In recent training I was surprised to know that many people think that as soon as computed columns are created the column is materialized and the data is now stored in the column just like usual. In fact this is not true. If computed column is not marked as persisted, it is not created when the column is created, in fact it is still computed at<strong> run time</strong>. Once you mark column as persisted, it is computed right away and stored in the data table.</p>
<p style="text-align:justify;">Let us see quickly following example of the creating computed column.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">tempdb<br />
GO<br />
</span><span style="color:green;">-- Create Table<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">UDFEffect </span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">,<br />
</span><span style="color:black;">FirstName </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">),<br />
</span><span style="color:black;">LastName </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">))<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Insert One Hundred Thousand Records<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">UDFEffect </span><span style="color:gray;">(</span><span style="color:black;">ID</span><span style="color:gray;">,</span><span style="color:black;">FirstName</span><span style="color:gray;">,</span><span style="color:black;">LastName</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT TOP </span><span style="color:black;">100000 ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">a.name</span><span style="color:gray;">) </span><span style="color:black;">RowID</span><span style="color:gray;">,<br />
</span><span style="color:red;">'Bob'</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">CASE </span><span style="color:blue;">WHEN </span><span style="color:black;">ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">a.name</span><span style="color:gray;">)%</span><span style="color:black;">2 </span><span style="color:blue;">= </span><span style="color:black;">1 </span><span style="color:blue;">THEN </span><span style="color:red;">'Smith'<br />
</span><span style="color:blue;">ELSE </span><span style="color:red;">'Brown' </span><span style="color:blue;">END<br />
FROM </span><span style="color:black;">sys.all_objects a<br />
</span><span style="color:gray;">CROSS </span><span style="color:blue;">JOIN </span><span style="color:black;">sys.all_objects b<br />
GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'UDFEffect'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Add Computed Column<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">dbo.UDFEffect </span><span style="color:blue;">ADD<br />
</span><span style="color:black;">FullName </span><span style="color:blue;">AS </span><span style="color:gray;">(</span><span style="color:black;">FirstName</span><span style="color:gray;">+</span><span style="color:red;">' '</span><span style="color:gray;">+</span><span style="color:black;">LastName</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'UDFEffect'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Add Computed Column PERSISTED<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">dbo.UDFEffect </span><span style="color:blue;">ADD<br />
</span><span style="color:black;">FullName_P </span><span style="color:blue;">AS </span><span style="color:gray;">(</span><span style="color:black;">FirstName</span><span style="color:gray;">+</span><span style="color:red;">' '</span><span style="color:gray;">+</span><span style="color:black;">LastName</span><span style="color:gray;">) </span><span style="color:black;">PERSISTED<br />
GO<br />
</span><span style="color:green;">-- Check the space used by table<br />
</span><span style="color:darkred;">sp_spaceused </span><span style="color:red;">'UDFEffect'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Clean up Database<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:black;">UDFEffect<br />
GO</span></code></p>
<p style="text-align:justify;">I have used the system stored procedure sp_spaceused to find out the space used in the query.</p>
<p style="text-align:justify;">From the resultset it is very clear that when I created the computed column, it did not take any additional space in the database. However, when I created computed column marked as PERSISTED it indeed took more space in the data table and the size of the table is grown larger.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/persisted.jpg" alt="" width="450" height="367" /></p>
<p style="text-align:justify;">I hope this clear it up. In future article I will write performance and efficiency of the computed columns.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a> Tagged: <a href='http://blog.sqlauthority.com/tag/computed-column/'>Computed Column</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/9663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/9663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/9663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=9663&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/07/27/sql-server-computed-column-persisted-and-storage/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/persisted.jpg" medium="image" />
	</item>
		<item>
		<title>SQLAuthority News &#8211; Storage and SQL Server Capacity Planning and configuration &#8211; SharePoint Server 2010</title>
		<link>http://blog.sqlauthority.com/2010/05/16/sqlauthority-news-storage-and-sql-server-capacity-planning-and-configuration-sharepoint-server-2010/</link>
		<comments>http://blog.sqlauthority.com/2010/05/16/sqlauthority-news-storage-and-sql-server-capacity-planning-and-configuration-sharepoint-server-2010/#comments</comments>
		<pubDate>Sun, 16 May 2010 01:30:12 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8970</guid>
		<description><![CDATA[Just a day ago, I was asked how do you plan SQL Server Storage Capacity. Here is the excellent article published by Microsoft regarding SQL Server capacity planning for SharePoint 2010. This article touches all the vital areas of this subject. Here are the bullet points for the same. Gather storage and SQL Server space [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8970&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Just a day ago, I was asked how do you plan SQL Server Storage Capacity. Here is the excellent article published by Microsoft regarding SQL Server capacity planning for SharePoint 2010. This article touches all the vital areas of this subject. Here are the bullet points for the same.</p>
<ul style="text-align:justify;">
<li>Gather storage and SQL Server space and I/O requirements</li>
<li>Choose SQL Server version and edition</li>
<li>Design storage architecture based on capacity and IO requirements</li>
<li>Determine memory requirements</li>
<li>Understand network topology requirements</li>
<li>Configure SQL Server</li>
<li>Validate storage performance and reliability</li>
</ul>
<p style="text-align:justify;">Read the original article published by Microsoft here: <a href="http://technet.microsoft.com/en-us/library/cc298801%28office.14%29.aspx" target="_blank">Storage and SQL Server Capacity Planning and configuration &#8211; SharePoint Server 2010</a>.</p>
<p style="text-align:justify;">The question to all the SharePoint developers and administrator that if they use the whitepapers and articles to decide the capacity or they just start with application and as they progress they plan the storage? Please let me know your opinion.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
<br />Filed under: <a href='http://blog.sqlauthority.com/category/sharepoint/'>SharePoint</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sql-white-papers/'>SQL White Papers</a>, <a href='http://blog.sqlauthority.com/category/sqlauthority/sqlauthority-news/'>SQLAuthority News</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8970/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8970&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/05/16/sqlauthority-news-storage-and-sql-server-capacity-planning-and-configuration-sharepoint-server-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Size of Index Table for Each Index &#8211; Solution 2</title>
		<link>http://blog.sqlauthority.com/2010/05/09/sql-server-size-of-index-table-for-each-index-solution-2/</link>
		<comments>http://blog.sqlauthority.com/2010/05/09/sql-server-size-of-index-table-for-each-index-solution-2/#comments</comments>
		<pubDate>Sun, 09 May 2010 01:30:05 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Index]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8901</guid>
		<description><![CDATA[Earlier I had ran puzzle where I asked question regarding size of index table for each index in database over here SQL SERVER – Size of Index Table – A Puzzle to Find Index Size for Each Index on Table. I had received good amount answers and I had blogged about that here SQL SERVER [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8901&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Earlier I had ran puzzle where I asked question regarding size of index table for each index in database over here <strong></strong><strong><a href="http://blog.sqlauthority.com/2009/11/18/sql-server-size-of-index-table-a-puzzle-to-find-index-size-for-each-index-on-table/" target="_blank">SQL SERVER – Size of Index Table – A Puzzle to Find  Index Size for Each Index on Table</a></strong>. I had received good amount answers and I had blogged about that here <strong><a href="http://blog.sqlauthority.com/2009/11/30/sql-server-size-of-index-table-for-each-index-solution/" target="_blank">SQL SERVER – Size of Index Table for Each Index – Solution</a></strong>. As a comment to that blog I have received another very interesting comment and that provides near accurate answers to original question. Many thanks to <strong><a href="http://blog.sqlauthority.com/2009/11/30/sql-server-size-of-index-table-for-each-index-solution/#comment-58076" target="_blank">Rama Mathanmohan</a></strong> for providing wonderful solution.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT<br />
</span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">TableName</span><span style="color:gray;">,<br />
</span><span style="color:black;">i.name </span><span style="color:blue;">AS </span><span style="color:black;">IndexName</span><span style="color:gray;">,<br />
</span><span style="color:black;">i.index_id </span><span style="color:blue;">AS </span><span style="color:black;">IndexID</span><span style="color:gray;">,<br />
</span><span style="color:black;">8 </span><span style="color:gray;">* </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">a.used_pages</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:red;">'Indexsize(KB)'<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.indexes </span><span style="color:blue;">AS </span><span style="color:black;">i<br />
</span><span style="color:blue;">JOIN </span><span style="color:black;">sys.partitions </span><span style="color:blue;">AS </span><span style="color:black;">p </span><span style="color:blue;">ON </span><span style="color:black;">p.</span><span style="color:magenta;">OBJECT_ID </span><span style="color:blue;">= </span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID </span><span style="color:gray;">AND </span><span style="color:black;">p.index_id </span><span style="color:blue;">= </span><span style="color:black;">i.index_id<br />
</span><span style="color:blue;">JOIN </span><span style="color:black;">sys.allocation_units </span><span style="color:blue;">AS </span><span style="color:black;">a </span><span style="color:blue;">ON </span><span style="color:black;">a.container_id </span><span style="color:blue;">= </span><span style="color:black;">p.partition_id<br />
</span><span style="color:blue;">GROUP BY </span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">,</span><span style="color:black;">i.index_id</span><span style="color:gray;">,</span><span style="color:black;">i.name<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">),</span><span style="color:black;">i.index_id</span></code></p>
<p style="text-align:justify;">Let me know if you have any better script for the same.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/readers-contribution/'>Readers Contribution</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-index/'>SQL Index</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8901/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8901/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8901/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8901&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/05/09/sql-server-size-of-index-table-for-each-index-solution-2/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; SHRINKFILE and TRUNCATE Log File in SQL Server 2008</title>
		<link>http://blog.sqlauthority.com/2010/05/03/sql-server-shrinkfile-and-truncate-log-file-in-sql-server-2008/</link>
		<comments>http://blog.sqlauthority.com/2010/05/03/sql-server-shrinkfile-and-truncate-log-file-in-sql-server-2008/#comments</comments>
		<pubDate>Mon, 03 May 2010 01:30:21 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8861</guid>
		<description><![CDATA[Note: Please read the complete post before taking any actions. This blog post would discuss SHRINKFILE and TRUNCATE Log File. The script mentioned in the email received from reader contains the following questionable code: &#8220;Hi Pinal, If you could remember, I and my manager met you at TechEd in Bangalore. We just upgraded to SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8861&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><em>Note:</em> Please read the complete post before taking any actions.</p>
<p style="text-align:justify;">This blog post would discuss SHRINKFILE and TRUNCATE Log File. The script mentioned in the email received from reader contains the following questionable code:</p>
<p style="text-align:justify;padding-left:30px;">&#8220;Hi Pinal,</p>
<p style="text-align:justify;padding-left:30px;">If you could remember, I and my manager met you at TechEd in Bangalore.</p>
<p style="text-align:justify;padding-left:30px;">We just upgraded to SQL Server 2008. One of our jobs failed as it was using the following code.</p>
<p style="text-align:justify;padding-left:30px;">The error was:</p>
<p style="text-align:justify;padding-left:30px;"><span style="color:#ff0000;">Msg 155, Level 15, State 1, Line 1<br />
&#8216;TRUNCATE_ONLY&#8217; is not a recognized BACKUP option.</span></p>
<p style="text-align:justify;padding-left:30px;">The code was:</p>
<p style="text-align:justify;padding-left:30px;"><code style="font-size:12px;"><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKFILE</span><span style="color:gray;">(</span><span style="color:black;">TestDBLog</span><span style="color:gray;">, </span><span style="color:black;">1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">BACKUP </span><span style="color:magenta;">LOG </span><span style="color:black;">TestDB </span><span style="color:blue;">WITH </span><span style="color:black;">TRUNCATE_ONLY<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKFILE</span><span style="color:gray;">(</span><span style="color:black;">TestDBLog</span><span style="color:gray;">, </span><span style="color:black;">1</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO </span></code></p>
<p style="text-align:justify;padding-left:30px;">I have modified that code to subsequent code and it works fine. But, are there other suggestions you have at the moment?</p>
<p style="text-align:justify;padding-left:30px;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">[master]<br />
GO<br />
</span><span style="color:blue;">ALTER DATABASE </span><span style="color:black;">[TestDb] </span><span style="color:blue;">SET </span><span style="color:black;">RECOVERY SIMPLE </span><span style="color:blue;">WITH </span><span style="color:black;">NO_WAIT<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKFILE</span><span style="color:gray;">(</span><span style="color:black;">TestDbLog</span><span style="color:gray;">, </span><span style="color:black;">1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">ALTER DATABASE </span><span style="color:black;">[TestDb] </span><span style="color:blue;">SET </span><span style="color:black;">RECOVERY </span><span style="color:blue;">FULL WITH </span><span style="color:black;">NO_WAIT<br />
GO</span></code></p>
<p style="text-align:justify;padding-left:30px;">Configuration of our server and system is as follows:</p>
<p style="text-align:justify;padding-left:30px;">[Removed not relevant data]&#8220;</p>
<p style="text-align:justify;">An email like this that suddenly pops out in early morning is alarming email. Because I am a dead, busy mind, so I had only one min to reply. I wrote down quickly the following note. (As I said, it was a single-minute email so it is not completely accurate). Here is that quick email shared with all of you.</p>
<p style="text-align:justify;">&#8220;Hi Mr. DBA [removed the name]</p>
<p style="text-align:justify;">Thanks for your email. I suggest you stop this practice. There are many issues included here, but I would list two major issues:</p>
<p style="text-align:justify;">1) From the setting database to simple recovery, shrinking the file and once again setting in full recovery, you are in fact losing your valuable log data and will be not able to restore point in time. Not only that, you will also not able to use subsequent log files.</p>
<p style="text-align:justify;">2) Shrinking database file or database adds fragmentation.</p>
<p style="text-align:justify;">There are a lot of things you can do. First, start taking proper log backup using following command instead of truncating them and losing them frequently.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BACKUP </span><span style="color:magenta;">LOG </span><span style="color:black;">[TestDb] </span><span style="color:blue;">TO  DISK = </span><span style="color:red;">N'C:\Backup\TestDb.bak'<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Remove the code of SHRINKING the file. If you are taking proper log backups, your log file usually (again usually, special cases are excluded) do not grow very big.</p>
<p style="text-align:justify;">There are so many things to add here, but you can call me on my [phone number]. Before you call me, I suggest for accuracy you read <a href="http://www.sqlskills.com/BLOGS/PAUL/" target="_blank">Paul Randel</a>&#8216;s two posts <a href="http://www.sqlskills.com/BLOGS/PAUL/post/Why-you-should-not-shrink-your-data-files.aspx" target="_blank">here</a> and <a href="http://www.sqlskills.com/blogs/paul/post/backup-log-with-no_log-use-abuse-and-undocumented-trace-flags-to-stop-it.aspx" target="_blank">here</a> and <a href="http://www.brentozar.com/" target="_blank">Brent Ozar</a>&#8216;s Post <a href="http://sqlserverpedia.com/blog/sql-server-backup-and-restore/backup-log-with-truncate_only-like-a-bear-trap/" target="_blank">here</a>.</p>
<p style="text-align:justify;">Kind Regards,<br />
Pinal Dave&#8221;</p>
<p style="text-align:justify;">I guess this post is very much clear to you. Please leave your comments here. As mentioned, this is a very huge subject; I have just touched a tip of the ice-berg and have tried to point to authentic knowledge.</p>
<p style="text-align:justify;">Update: Small typo correction and small detail corrected based on feedback.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-backup-and-restore/'>SQL Backup and Restore</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8861/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8861/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8861&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/05/03/sql-server-shrinkfile-and-truncate-log-file-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; GUID vs INT &#8211; Your Opinion</title>
		<link>http://blog.sqlauthority.com/2010/04/28/sql-server-guid-vs-int-your-opinion/</link>
		<comments>http://blog.sqlauthority.com/2010/04/28/sql-server-guid-vs-int-your-opinion/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 01:30:39 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Constraint and Keys]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8811</guid>
		<description><![CDATA[I think the title is clear what I am going to write in your post. This is age old problem and I want to compile the list stating advantages and disadvantages of using GUID and INT as a Primary Key or Clustered Index or Both (the usual case). Let me start a list by suggesting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8811&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I think the title is clear what I am going to write in your post.</p>
<p style="text-align:justify;">This is age old problem and I want to compile the list stating advantages and disadvantages of using GUID and INT as a Primary Key or Clustered Index or Both (the usual case).</p>
<p style="text-align:justify;">Let me start a list by suggesting one advantage and one disadvantage in each case.</p>
<h3 style="text-align:justify;">INT</h3>
<p style="text-align:justify;"><strong>Advantage: </strong></p>
<ol style="text-align:justify;">
<li>Numeric values (and specifically integers) are better for performance when used in joins, indexes and conditions.</li>
<li>Numeric values are easier to understand for application users if they are displayed.</li>
</ol>
<p style="text-align:justify;"><strong>Disadvantage:</strong></p>
<ol style="text-align:justify;">
<li>If your table is large, it is quite possible it will run out of it and after some numeric value there will be no additional identity to use.</li>
</ol>
<h3 style="text-align:justify;">GUID</h3>
<p style="text-align:justify;"><strong>Advantage:</strong></p>
<ol style="text-align:justify;">
<li>Unique across the server.</li>
</ol>
<p style="text-align:justify;"><strong>Disadvantage:</strong></p>
<ol style="text-align:justify;">
<li>String values are not as optimal as integer values for performance when used in joins, indexes and conditions.</li>
<li>More storage space is required than INT.</li>
</ol>
<p style="text-align:justify;">Please note that I am looking to create list of all the generic comparisons. There can be special cases where the stated information is incorrect, feel free to comment on the same.</p>
<p style="text-align:justify;">Please leave your opinion and advice in comment section. I will combine a final list and update this blog after a week. By listing your name in post, I will also give due credit.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-constraint-and-keys/'>SQL Constraint and Keys</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8811/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8811&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/04/28/sql-server-guid-vs-int-your-opinion/feed/</wfw:commentRss>
		<slash:comments>84</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER – Attach mdf file without ldf file in Database</title>
		<link>http://blog.sqlauthority.com/2010/04/26/sql-server-attach-mdf-file-without-ldf-file-in-database/</link>
		<comments>http://blog.sqlauthority.com/2010/04/26/sql-server-attach-mdf-file-without-ldf-file-in-database/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 01:30:33 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8709</guid>
		<description><![CDATA[Background Story: One of my friends recently called up and asked me if I had spare time to look at his database and give him a performance tuning advice. Because I had some free time to help him out, I said yes. I asked him to send me the details of his database structure and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8709&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><strong>Background Story:</strong><br />
One of my friends recently called up and asked me if I had spare time to look at his database and give him a performance tuning advice. Because I had some free time to help him out, I said yes. I asked him to send me the details of his database structure and sample data. He said that since his database is in a very early stage and is small as of the moment, so he told me that he would like me to have a complete database. My response to him was “Sure! In that case, take a backup of the database and send it to me. I will restore it into my computer and play with it.”</p>
<p style="text-align:justify;">He did send me his database; however, his method made me write this quick note here. Instead of taking a full backup of the database and sending it to me, he sent me only the .mdf (primary database file). In fact, I asked for a complete backup (I wanted to review file groups, files, as well as few other details).  Upon calling my friend,  I found that he was not available. Now,  he left me with only a .mdf file. As I had some extra time, I decided to checkout his database structure and get back to him regarding the full backup, whenever I can get in touch with him again.</p>
<p style="text-align:justify;"><strong>Technical Talk: </strong><br />
If the database is shutdown gracefully and there was no abrupt shutdown (power outrages, pulling plugs to machines, machine crashes or any other reasons), it is <em>possible </em>(there’s no guarantee) to attach .mdf file only to the server. Please note that there can be many more reasons for a database that is not getting attached or restored. In my case, the database had a clean shutdown and there were no complex issues. I was able to recreate a transaction log file and attached the received .mdf file.</p>
<p style="text-align:justify;">There are multiple ways of doing this. I am listing all of them here. Before using any of them, please consult the Domain Expert in your company or industry. Also, never attempt this on live/production server without the presence of a Disaster Recovery expert.<strong> </strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">[master]<br />
GO<br />
</span><span style="color:green;">-- Method 1: I use this method<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_attach_single_file_db </span><span style="color:#434343;">@dbname</span><span style="color:blue;">=</span><span style="color:red;">'TestDb'</span><span style="color:gray;">,<br />
</span><span style="color:#434343;">@physname</span><span style="color:blue;">=</span><span style="color:red;">N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestDb.mdf'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Method 2:<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">TestDb </span><span style="color:blue;">ON<br />
</span><span style="color:gray;">(</span><span style="color:black;">FILENAME </span><span style="color:blue;">= </span><span style="color:red;">N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestDb.mdf'</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FOR </span><span style="color:black;">ATTACH_REBUILD_LOG<br />
GO</span></code></p>
<p style="text-align:justify;">Method 2: If one or more log files are missing, they are recreated again.</p>
<p style="text-align:justify;">There is one more method which I am demonstrating here but<em> I</em> <em>have not used myself before</em>. According to Book Online, it will work only if there is one log file that is missing. If there are more than one log files involved, all of them are required to undergo the same procedure.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">-- Method 3:<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">TestDb </span><span style="color:blue;">ON<br />
</span><span style="color:gray;">( </span><span style="color:black;">FILENAME </span><span style="color:blue;">= </span><span style="color:red;">N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestDb.mdf'</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FOR </span><span style="color:black;">ATTACH<br />
GO<br />
</span></code></p>
<p style="text-align:justify;">Please read the <a href="http://technet.microsoft.com/en-us/library/ms176061.aspx" target="_blank">Book Online</a> in depth and consult DR experts before working on the production server. In my case, the above syntax just worked fine as the database was clean when it was detached. Feel free to write your opinions and experiences for it will help the IT community to learn more from your suggestions and skills.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/readers-question/'>Readers Question</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-backup-and-restore/'>SQL Backup and Restore</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8709/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8709/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8709&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/04/26/sql-server-attach-mdf-file-without-ldf-file-in-database/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Retrieve and Explore Database Backup without Restoring Database &#8211; Idera virtual database</title>
		<link>http://blog.sqlauthority.com/2010/04/06/sql-server-retrieve-and-explore-database-backup-without-restoring-database-idera-virtual-database/</link>
		<comments>http://blog.sqlauthority.com/2010/04/06/sql-server-retrieve-and-explore-database-backup-without-restoring-database-idera-virtual-database/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 01:30:28 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Idera]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8172</guid>
		<description><![CDATA[I recently downloaded Idera’s SQL virtual database, and tested it. There are a few things about this tool which caught my attention. My Scenario It is quite common in real life that sometimes observing or retrieving older data is necessary; however, it had changed as time passed by. The full database backup was 40 GB [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8172&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I recently downloaded Idera’s SQL <a href="http://www.idera.com/?s=BN_SQLAuth" target="_blank"><strong>virtual database</strong></a>, and tested it. There are a few things about this tool which caught my attention.</p>
<p style="text-align:justify;"><strong>My Scenario</strong></p>
<p style="text-align:justify;">It is quite common in real life that sometimes observing or retrieving older data is necessary; however, it had changed as time passed by. The full database backup was 40 GB in size, and, to restore it on our production server, it usually takes around 16 to 22 minutes, depending on the load server that is usually present. This range in time varies from one server to another as per the configuration of the computer. Some other issues we used to have are the following:</p>
<ol style="text-align:justify;">
<li>When we try to restore a large 40-GB database, we needed at      least that much space on our production server.</li>
<li>Once in a while, we even had to make changes in the restored      database, and use the said changed and restored database for our purpose,      making it more time-consuming.</li>
</ol>
<p style="text-align:justify;"><strong>My Solution</strong></p>
<p style="text-align:justify;">I have heard a lot about the Idera’s SQL <a href="http://www.idera.com/?s=BN_SQLAuth" target="_blank"><strong>virtual database</strong></a> tool.. Well, right after we started to test this tool, we found out that it really delivers what it promises. Using this software was very easy and we were able to restore our database from backup in less than 2 minutes, sparing us from the usual longer time of 16–22 minutes. The needful was finished in a total of 10 minutes. Another interesting observation is that there is no need to have an additional space for restoring the database. For complete database restoration, the single additional MB on the drive is not required anymore. We can use the database in the same way as our regular database, and there is no need for any additional configuration and setup.</p>
<p style="text-align:justify;">Let us look at the most relevant points of this product based on my initial experience:</p>
<ul style="text-align:justify;">
<li>Quick restoration of the database backup</li>
<li>No additional space required for database restoration</li>
<li>virtual database has no physical .MDF or .LDF</li>
<li>The database which is restored is, in fact, the backup file      converted in the virtual database. DDL and DML queries can be executed      against this virtually restored database.</li>
<li>Regular backup operation can be implemented against virtual      database, creating a physical .bak file that can be used for future use.</li>
<li>There was no observed degradation in performance on the      original database as well the restored virtual database.</li>
<li>Additional T-SQL queries can be let off on the virtual database.</li>
</ul>
<p style="text-align:justify;">Well, this summarizes my quick review. And, as I was saying, I am very impressed with the product and I plan to explore it more. There are many features that I have noticed in this tool, which I think can be very useful if properly understood.</p>
<p style="text-align:justify;">I had taken a few screenshots using my demo database afterwards. Let us see what other things this tool can do besides the mentioned activities. I am surprised with its performance so I want to know how exactly this feature works, specifically in the matter of why it does not create any additional files and yet, it still allows update on the virtually restored database. I guess I will have to send an e-mail to the developers of Idera and try to figure this out from them.</p>
<p style="text-align:justify;">I think this tool is very useful, and it delivers a high level of performance way more than what I expected. Soon, I will write a review for additional uses of SQL virtual database.. If you are using SQL virtual database in your production environment, I am eager to learn more about it and your experience while using it.</p>
<p style="text-align:justify;"><strong>The &#8216;Virtual&#8217; Part of virtual database</strong></p>
<p style="text-align:justify;">When I set out to test this software, I thought virtual database had something to do with Hyper-V or visualization. In fact, the virtual database is a kind of database which shows up in your SQL Server Management Studio without actually restoring or even creating it. This tool creates a database in SSMS from the backup of the same database. The backup, however, works virtually the same way as original database.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/virtualdb1.jpg" alt="" width="395" height="254" /></p>
<p style="text-align:justify;"><strong><em>Potential Usage of virtual database:</em></strong></p>
<p style="text-align:justify;">As soon as I described this tool to my teammate, I think his very first reaction was, “hey, if we have this then there is no need for log shipping.” I find his comment very interesting as log shipping is something where logs are moved to another server. In fact, there are no updates on the database from log; I would rather compare it with Snapshot Replication. In fact, whatever we use, snapshot replicated database can be similarly used and configured with virtual database. I totally believe that we can use it for reporting purpose. In fact, after this database was configured, I think the uses of this tool are unlimited. I will have to spend some more time studying it and will get back to you.</p>
<p style="text-align:justify;"><em><strong>Click on images to see larger images.</strong></em></p>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="virtual database Console" href="http://www.pinaldave.com/bimg/idera/vdb1.jpg"><img title="virtual database Console" src="http://www.pinaldave.com/bimg/idera/vdb1.jpg" alt="" width="500" height="309" /></a></dt>
<dd class="wp-caption-dd">virtual database Console</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Harddrive Space before virtual database Setup" href="http://www.pinaldave.com/bimg/idera/vdb2.jpg"><img class=" " title="Harddrive Space before virtual database Setup" src="http://www.pinaldave.com/bimg/idera/vdb2.jpg" alt="" width="500" height="100" /></a></dt>
<dd class="wp-caption-dd">Harddrive Space before virtual database Setup</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Attach Full Backup Screen" href="http://www.pinaldave.com/bimg/idera/vdb3.jpg"><img title="Attach Full Backup Screen" src="http://www.pinaldave.com/bimg/idera/vdb3.jpg" alt="" width="500" height="224" /></a></dt>
<dd class="wp-caption-dd">Attach Full Backup Screen</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Backup on Harddrive" href="http://www.pinaldave.com/bimg/idera/vdb4.jpg"><img title="Backup on Harddrive" src="http://www.pinaldave.com/bimg/idera/vdb4.jpg" alt="" width="501" height="397" /></a></dt>
<dd class="wp-caption-dd">Backup on Harddrive</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Attach Full Backup Screen with Settings" href="http://www.pinaldave.com/bimg/idera/vdb5.jpg"><img title="Attach Full Backup Screen with Settings" src="http://www.pinaldave.com/bimg/idera/vdb5.jpg" alt="" width="500" height="224" /></a></dt>
<dd class="wp-caption-dd">Attach Full Backup Screen with Settings</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="virtual database Setup - less than 60 sec" href="http://www.pinaldave.com/bimg/idera/vdb6.jpg"><img title="virtual database Setup - less than 60 sec" src="http://www.pinaldave.com/bimg/idera/vdb6.jpg" alt="" width="499" height="307" /></a></dt>
<dd class="wp-caption-dd">virtual database Setup &#8211; less than 60 sec</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="virtual database Setup - Online" href="http://www.pinaldave.com/bimg/idera/vdb7.jpg"><img title="virtual database Setup - Online" src="http://www.pinaldave.com/bimg/idera/vdb7.jpg" alt="" width="501" height="311" /></a></dt>
<dd class="wp-caption-dd">virtual database Setup &#8211; Online</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Harddrive Space after virtual database Setup" href="http://www.pinaldave.com/bimg/idera/vdb2.jpg"><img title="Harddrive Space after virtual database Setup" src="http://www.pinaldave.com/bimg/idera/vdb2.jpg" alt="" width="500" height="100" /></a></dt>
<dd class="wp-caption-dd">Harddrive Space after virtual database Setup</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="Point in Time Recovery Option - Timeline View" href="http://www.pinaldave.com/bimg/idera/vdb9.jpg"><img title="Point in Time Recovery Option - Timeline View" src="http://www.pinaldave.com/bimg/idera/vdb9.jpg" alt="" width="499" height="328" /></a></dt>
<dd class="wp-caption-dd">Point in Time Recovery Option &#8211; Timeline View</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="virtual database Summary" href="http://www.pinaldave.com/bimg/idera/vdb10.jpg"><img title="virtual database Summary" src="http://www.pinaldave.com/bimg/idera/vdb10.jpg" alt="" width="499" height="327" /></a></dt>
<dd class="wp-caption-dd">virtual database Summary</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><a title="No Performance Difference between Regular DB vs Virtual DB" href="http://www.pinaldave.com/bimg/idera/vdb11.jpg"><img title="No Performance Difference between Regular DB vs Virtual DB" src="http://www.pinaldave.com/bimg/idera/vdb11.jpg" alt="" width="500" height="472" /></a></dt>
<dd class="wp-caption-dd">No Performance Difference between Regular DB vs Virtual DB</dd>
</dl>
</div>
<p style="text-align:justify;">Please note that all SQL Server MVP gets free license of this software.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>), Idera (</strong><a href="http://www.idera.com/?s=BN_SQLAuth" target="_blank"><strong>virtual database</strong></a>)</p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/database/'>Database</a>, <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/sql-add-on/'>SQL Add-On</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-backup-and-restore/'>SQL Backup and Restore</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sql-utility/'>SQL Utility</a>, <a href='http://blog.sqlauthority.com/category/sqlauthority/sqlauthority-news/'>SQLAuthority News</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a> Tagged: <a href='http://blog.sqlauthority.com/tag/idera/'>Idera</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8172&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/04/06/sql-server-retrieve-and-explore-database-backup-without-restoring-database-idera-virtual-database/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/virtualdb1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb1.jpg" medium="image">
			<media:title type="html">virtual database Console</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb2.jpg" medium="image">
			<media:title type="html">Harddrive Space before virtual database Setup</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb3.jpg" medium="image">
			<media:title type="html">Attach Full Backup Screen</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb4.jpg" medium="image">
			<media:title type="html">Backup on Harddrive</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb5.jpg" medium="image">
			<media:title type="html">Attach Full Backup Screen with Settings</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb6.jpg" medium="image">
			<media:title type="html">virtual database Setup - less than 60 sec</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb7.jpg" medium="image">
			<media:title type="html">virtual database Setup - Online</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb2.jpg" medium="image">
			<media:title type="html">Harddrive Space after virtual database Setup</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb9.jpg" medium="image">
			<media:title type="html">Point in Time Recovery Option - Timeline View</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb10.jpg" medium="image">
			<media:title type="html">virtual database Summary</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/idera/vdb11.jpg" medium="image">
			<media:title type="html">No Performance Difference between Regular DB vs Virtual DB</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Introduction to Snapshot Database &#8211; Restore From Snapshot</title>
		<link>http://blog.sqlauthority.com/2010/04/05/sql-server-2008-introduction-to-snapshot-database-restore-from-snapshot/</link>
		<comments>http://blog.sqlauthority.com/2010/04/05/sql-server-2008-introduction-to-snapshot-database-restore-from-snapshot/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 01:30:40 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8502</guid>
		<description><![CDATA[Snapshot database is one of the most interesting concepts that I have used at some places recently. Here is a quick definition of the subject from Book On Line: A Database Snapshot is a read-only, static view of a database (the source database). Multiple snapshots can exist on a source database and can always reside [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8502&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Snapshot database is one of the most interesting concepts that I have used at some places recently.</p>
<p style="text-align:justify;">Here is a quick definition of the subject from <a href="http://msdn.microsoft.com/en-us/library/ms175158.aspx" target="_blank">Book On Line</a>:</p>
<p style="text-align:justify;">A Database Snapshot is a read-only, static view of a database (the <em>source database</em>). Multiple snapshots can exist on a source database and can always reside on the same server instance as the database. Each database snapshot is consistent, in terms of transactions, with the source database as of the moment of the snapshot&#8217;s creation. A snapshot persists until it is explicitly dropped by the database owner.</p>
<p style="text-align:justify;">If you do not know how Snapshot database work, here is a quick note on the subject. However, please refer to the official description on Book-on-Line for accuracy. Snapshot database is a read-only database created from an original database called the “source database”. This database operates at page level. When Snapshot database is created, it is produced on sparse files; in fact, it does not occupy any space (or occupies very little space) in the Operating System. When any data page is modified in the source database, that data page is copied to Snapshot database, making the sparse file size increases. When an unmodified data page is read in the Snapshot database, it actually reads the pages of the original database. In other words, the changes that happen in the source database are reflected in the Snapshot database.</p>
<p style="text-align:justify;">Let us see a simple example of Snapshot. In the following exercise, we will do a few operations. Please note that this script is for demo purposes only- there are a few considerations of CPU, DISK I/O and memory, which will be discussed in the future posts.</p>
<ul style="text-align:justify;">
<li>Create Snapshot</li>
<li>Delete Data from Original DB</li>
<li>Restore Data from Snapshot</li>
</ul>
<p style="text-align:justify;">First, let us create the first Snapshot database and observe the sparse file details.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">master<br />
GO<br />
</span><span style="color:green;">-- Create Regular Database<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">RegularDB<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">RegularDB<br />
GO<br />
</span><span style="color:green;">-- Populate Regular Database with Sample Table<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">FirstTable </span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">Value </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">10</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">1</span><span style="color:gray;">, </span><span style="color:red;">'First'</span><span style="color:gray;">);<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">2</span><span style="color:gray;">, </span><span style="color:red;">'Second'</span><span style="color:gray;">);<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">3</span><span style="color:gray;">, </span><span style="color:red;">'Third'</span><span style="color:gray;">);<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Create Snapshot Database<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">SnapshotDB </span><span style="color:blue;">ON<br />
</span><span style="color:gray;">(</span><span style="color:black;">Name </span><span style="color:blue;">=</span><span style="color:red;">'RegularDB'</span><span style="color:gray;">,<br />
</span><span style="color:black;">FileName</span><span style="color:blue;">=</span><span style="color:red;">'c:\SSDB.ss1'</span><span style="color:gray;">)<br />
</span><span style="color:blue;">AS </span><span style="color:black;">SNAPSHOT </span><span style="color:blue;">OF </span><span style="color:black;">RegularDB</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Now let us see the resultset for the same.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot1.jpg" alt="" width="500" height="286" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot2.jpg" alt="" width="382" height="518" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot3.jpg" alt="" width="380" height="522" /></p>
<p style="text-align:justify;">Now let us do delete something from the Original DB and check the same details we checked before.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">-- Delete from Regular Database<br />
</span><span style="color:blue;">DELETE FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;"> </span></code><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot4.jpg?" alt="" width="500" height="275" /></p>
<p style="text-align:justify;">When we check the details of sparse file created by Snapshot database, we will find some interesting details. The details of Regular DB remain the same.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot6.jpg" alt="" width="381" height="527" /></p>
<p style="text-align:justify;">It clearly shows that when we delete data from Regular/Source DB, it copies the data pages to Snapshot database. This is the reason why the size of the snapshot DB is increased.</p>
<p style="text-align:justify;">Now let us take this small exercise to  the next level and restore our deleted data from Snapshot DB to Original Source DB.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">-- Restore Data from Snapshot Database<br />
</span><span style="color:blue;">USE </span><span style="color:black;">master<br />
GO<br />
</span><span style="color:blue;">RESTORE DATABASE </span><span style="color:black;">RegularDB<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">DATABASE_SNAPSHOT </span><span style="color:blue;">= </span><span style="color:red;">'SnapshotDB'</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Clean up<br />
</span><span style="color:blue;">DROP DATABASE </span><span style="color:black;">[SnapshotDB]</span><span style="color:gray;">;<br />
</span><span style="color:blue;">DROP DATABASE </span><span style="color:black;">[RegularDB]</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span></code></p>
<p style="text-align:justify;">Now let us check the details of the select statement and we can see that we are successful able to restore the database from Snapshot Database.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/snapshot1.jpg" alt="" width="500" height="286" /></p>
<p style="text-align:justify;">We can clearly see that this is a very useful feature in case you would encounter a good business that needs it.</p>
<p style="text-align:justify;">I would like to request the readers to suggest more details if they are using this feature in their business. Also, let me know if you think it can be potentially used to achieve any tasks.</p>
<p style="text-align:justify;">Complete Script of the afore- mentioned operation for easy reference is as follows:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">master<br />
GO<br />
</span><span style="color:green;">-- Create Regular Database<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">RegularDB<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">RegularDB<br />
GO<br />
</span><span style="color:green;">-- Populate Regular Database with Sample Table<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">FirstTable </span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">Value </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">10</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">1</span><span style="color:gray;">, </span><span style="color:red;">'First'</span><span style="color:gray;">);<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">2</span><span style="color:gray;">, </span><span style="color:red;">'Second'</span><span style="color:gray;">);<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">FirstTable </span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:black;">3</span><span style="color:gray;">, </span><span style="color:red;">'Third'</span><span style="color:gray;">);<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Create Snapshot Database<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">SnapshotDB </span><span style="color:blue;">ON<br />
</span><span style="color:gray;">(</span><span style="color:black;">Name </span><span style="color:blue;">=</span><span style="color:red;">'RegularDB'</span><span style="color:gray;">,<br />
</span><span style="color:black;">FileName</span><span style="color:blue;">=</span><span style="color:red;">'c:\SSDB.ss1'</span><span style="color:gray;">)<br />
</span><span style="color:blue;">AS </span><span style="color:black;">SNAPSHOT </span><span style="color:blue;">OF </span><span style="color:black;">RegularDB</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Delete from Regular Database<br />
</span><span style="color:blue;">DELETE FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Restore Data from Snapshot Database<br />
</span><span style="color:blue;">USE </span><span style="color:black;">master<br />
GO<br />
</span><span style="color:blue;">RESTORE DATABASE </span><span style="color:black;">RegularDB<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">DATABASE_SNAPSHOT </span><span style="color:blue;">= </span><span style="color:red;">'SnapshotDB'</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Select from Regular and Snapshot Database<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">RegularDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">SnapshotDB.dbo.FirstTable</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Clean up<br />
</span><span style="color:blue;">DROP DATABASE </span><span style="color:black;">[SnapshotDB]</span><span style="color:gray;">;<br />
</span><span style="color:blue;">DROP DATABASE </span><span style="color:black;">[RegularDB]</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-backup-and-restore/'>SQL Backup and Restore</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8502&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/04/05/sql-server-2008-introduction-to-snapshot-database-restore-from-snapshot/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/snapshot1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/snapshot2.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/snapshot3.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/snapshot4.jpg?" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/snapshot6.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/snapshot1.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Data and Page Compressions &#8211; Data Storage and IO Improvement</title>
		<link>http://blog.sqlauthority.com/2010/03/01/sql-server-data-and-page-compressions-data-storage-and-io-improvement/</link>
		<comments>http://blog.sqlauthority.com/2010/03/01/sql-server-data-and-page-compressions-data-storage-and-io-improvement/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 01:30:40 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Index]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8084</guid>
		<description><![CDATA[The performance of SQL Server is primarily decided by the disk I/O efficiency. Improving I/O definitely improves the performance. SQL Server 2008 introduced Data and Backup compression features to improve the disk I/O. Here, I will explain Data compression. Data compression implies the reduction in the disk space reserved by data. Therefore, data compression can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8084&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">The performance of SQL Server is primarily decided by the disk I/O efficiency. Improving I/O definitely improves the performance. SQL Server 2008 introduced Data and Backup compression features to improve the disk I/O. Here, I will explain Data compression.</p>
<p style="text-align:justify;">Data compression implies the reduction in the disk space reserved by data. Therefore, data compression can be configured for a table, clustered index, non-clustered index, indexed view or a partition of table or index.</p>
<p style="text-align:justify;">Data compression is implemented at two levels: ROW and PAGE. Even page compression automatically implements row compression. Tables and indexes can be compressed when they are created by using the CREATE TABLE and CREATE INDEX statements. To change the compression state of a table, index, or partition, use the ALTER TABLE.. REBUILD WITH or ALTER INDEX.. REBUILD WITH statements. When compression state of a heap is changed, all non-clustered index are rebuilt (not with the compression type of table but there own).</p>
<p style="text-align:justify;">Let me tell you what happens during the compression of data. In Row compression, the following four methods are used to remove unused space:</p>
<ol style="text-align:justify;">
<li>The metadata overhead of the record      is reduced.</li>
<li>All numeric (for example<strong> </strong><strong>intege</strong><strong>r</strong>,<strong> </strong><strong>decima</strong><strong>l</strong>,      and<strong> </strong><strong>floa</strong><strong>t)</strong> and numeric-based (for example<strong> </strong><strong>datetim</strong><strong>e</strong> and<strong> </strong><strong>mone</strong><strong>y</strong>)      data type values are converted into variable length values. By default, the      values of these data types are stored as fixed length like integer in 4      bytes datetime in 8 bytes, but after compression all unconsumed space is reclaimed.      For example, a value 100 is stored in an integer-type column. We know an      integer value between 0 and 255 can be stored in 1 byte. However, it      reserves 4 bytes (integer type takes 4 bytes) on disk. Here, after      compression, 3 bytes are reclaimed.</li>
<li>CHAR and NCHAR type values are      stored in variable length format. After compression, no blank character is      stored with this type of data. For example, a value “DBMS” is stored in      CHAR(10) type column. By default, this value will reserve 10 bytes on disk,      but after compression, it will reserve only 4 bytes.</li>
<li>NULL and 0 values across all data      types are optimized and take no bytes.</li>
</ol>
<p style="text-align:justify;">Page compression is implemented through the following three methods:</p>
<ol style="text-align:justify;">
<li>Row compression: as discussed above</li>
<li>Prefix compression: In each page, for each column, a common value from all rows is identified and stored in a row below the header. After that, from all the rows, that common value is replaced with the reference of header row.</li>
<li>Dictionary compression: Dictionary compression is same concept as that of Prefix compression implemented the second time. In Prefix compression, a separate common value is identified for each column, but in Dictionary compression, common values are identified from all columns in that page and stored in second row below the header. Then, these common values are replaced with the reference of values in new row.</li>
</ol>
<p style="text-align:justify;">Below is an example. Even it is not a good practical scenario, but sufficiently explains the compression functionality.</p>
<p style="text-align:justify;">Review your database for performance and implement this strategies. Let us run the following different row level and page level compression and observe the size of the table once compression is in place.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">tempdb<br />
GO<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">TestCompression </span><span style="color:gray;">(</span><span style="color:black;">col1 </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">col2 </span><span style="color:blue;">CHAR</span><span style="color:gray;">(</span><span style="color:black;">50</span><span style="color:gray;">))<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">TestCompression </span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:black;">10</span><span style="color:gray;">, </span><span style="color:red;">'compression testing'</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO 5000<br />
</span><span style="color:green;">-- Original<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_spaceused </span><span style="color:black;">TestCompression<br />
GO<br />
</span><span style="color:green;">-- DATA_COMPRESSION = ROW<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">TestCompression<br />
REBUILD </span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:black;">DATA_COMPRESSION </span><span style="color:blue;">= </span><span style="color:black;">ROW</span><span style="color:gray;">);<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_spaceused </span><span style="color:black;">TestCompression<br />
GO<br />
</span><span style="color:green;">-- DATA_COMPRESSION = PAGE<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">TestCompression<br />
REBUILD </span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:black;">DATA_COMPRESSION </span><span style="color:blue;">= </span><span style="color:black;">PAGE</span><span style="color:gray;">);<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_spaceused </span><span style="color:black;">TestCompression<br />
GO<br />
</span><span style="color:green;">-- DATA_COMPRESSION = NONE<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">TestCompression<br />
REBUILD </span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:black;">DATA_COMPRESSION </span><span style="color:blue;">= </span><span style="color:black;">NONE</span><span style="color:gray;">);<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_spaceused </span><span style="color:black;">TestCompression<br />
GO<br />
</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/datacompression.jpg" alt="" width="500" height="500" /></p>
<p style="text-align:justify;">Do you use this compression on your production server? If yes, it will be interesting if you share your feedback with us over here.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-index/'>SQL Index</a>, <a href='http://blog.sqlauthority.com/category/sql-optimization/'>SQL Optimization</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8084/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8084/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=8084&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/03/01/sql-server-data-and-page-compressions-data-storage-and-io-improvement/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/datacompression.jpg" medium="image" />
	</item>
		<item>
		<title>SQLAuthority News &#8211; SQL Server Technical Article &#8211; The Data Loading Performance Guide</title>
		<link>http://blog.sqlauthority.com/2010/02/17/sqlauthority-news-sql-server-technical-article-the-data-loading-performance-guide/</link>
		<comments>http://blog.sqlauthority.com/2010/02/17/sqlauthority-news-sql-server-technical-article-the-data-loading-performance-guide/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 01:30:43 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7998</guid>
		<description><![CDATA[Note: SQL Server Technical Article &#8211; The Data Loading Performance Guide by Microsoft The white paper describes load strategies for achieving high-speed data modifications of a Microsoft SQL Server database. &#8220;Bulk Load Methods” and “Other Minimally Logged and Metadata Operations” provide an overview of two key and interrelated concepts for high-speed data loading: bulk loading [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7998&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Note: <strong><a href="http://msdn.microsoft.com/en-us/library/dd425070.aspx" target="_blank">SQL Server Technical Article &#8211; The Data Loading  Performance Guide</a></strong> by Microsoft</p>
<p style="text-align:justify;">The white paper describes load strategies for achieving high-speed data modifications of a Microsoft SQL Server database.</p>
<p style="text-align:justify;">&#8220;Bulk Load Methods” and “Other Minimally Logged and Metadata Operations” provide an overview of two key and interrelated concepts for high-speed data loading: bulk loading and metadata operations.</p>
<p style="text-align:justify;">After this background knowledge, white paper describe how these methods can be used to solve customer scenarios. Script examples illustrating common design pattern are found in “Solving Typical Scenarios with Bulk Loading” Special consideration must be taken when you need to load and read data concurrently in the same table. The section “Bulk Load, NOLOCK Queries, and Read Committed Snapshot Isolation” describes methods you can use to achieve concurrent loading and reading.</p>
<p style="text-align:justify;">This white paper concludes with troubleshooting hints in “Optimizing Bulk Load”.</p>
<p style="text-align:justify;"><strong><a href="http://msdn.microsoft.com/en-us/library/dd425070.aspx" target="_blank">SQL Server Technical Article &#8211; The Data Loading Performance Guide</a></strong></p>
<p style="text-align:justify;">Abstract courtesy : Microsoft</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-data-storage/'>SQL Data Storage</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sql-white-papers/'>SQL White Papers</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7998/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7998/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7998/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7998&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/02/17/sqlauthority-news-sql-server-technical-article-the-data-loading-performance-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Find Location of Data File Using T-SQL</title>
		<link>http://blog.sqlauthority.com/2010/01/02/sql-server-find-location-of-data-file-using-t-sql/</link>
		<comments>http://blog.sqlauthority.com/2010/01/02/sql-server-find-location-of-data-file-using-t-sql/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 01:30:22 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7669</guid>
		<description><![CDATA[While preparing for the training course of Microsoft SQL Server 2005/2008 Query Optimization and &#38; Performance Tuning, I needed to find out where my database files are stored on my hard drive. It is when following script came in handy. SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) DataFileLocation FROM master.sys.master_files WHERE database_id = 1 AND FILE_ID [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7669&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">While preparing for the training course of <strong><a href="http://blog.sqlauthority.com/sql-server-performance-tuning/" target="_blank">Microsoft SQL Server 2005/2008 Query Optimization and &amp; Performance Tuning</a></strong>, I needed to find out where my database files are stored on my hard drive. It is when following script came in handy.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">SUBSTRING</span><span style="color:gray;">(</span><span style="color:black;">physical_name</span><span style="color:gray;">, </span><span style="color:black;">1</span><span style="color:gray;">,<br />
</span><span style="color:blue;">CHARINDEX</span><span style="color:gray;">(</span><span style="color:red;">N'master.mdf'</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">LOWER</span><span style="color:gray;">(</span><span style="color:black;">physical_name</span><span style="color:gray;">)) - </span><span style="color:black;">1</span><span style="color:gray;">) </span><span style="color:black;">DataFileLocation<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">master.sys.master_files<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">database_id </span><span style="color:blue;">= </span><span style="color:black;">1 </span><span style="color:gray;">AND </span><span style="color:magenta;">FILE_ID </span><span style="color:blue;">= </span><span style="color:black;">1</span></code></p>
<p style="text-align:justify;"><strong><span style="color:black;">Resultset:</span></strong></p>
<pre style="text-align:justify;">DataFileLocation
--------------------------------------------------------------------------
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\
(1 row(s) affected)</pre>
<p style="text-align:justify;">Above script provided exact location of where my data files of master database is. In fact, you can use it to find any other path of database as needed.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7669/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7669&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/01/02/sql-server-find-location-of-data-file-using-t-sql/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQLAuthority News &#8211; Data Compression Strategy Capacity Planning and Best Practices</title>
		<link>http://blog.sqlauthority.com/2009/11/07/sqlauthority-news-data-compression-strategy-capacity-planning-and-best-practices/</link>
		<comments>http://blog.sqlauthority.com/2009/11/07/sqlauthority-news-data-compression-strategy-capacity-planning-and-best-practices/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 01:30:34 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Compression]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7162</guid>
		<description><![CDATA[Data Compression: Strategy, Capacity Planning and Best Practices SQL Server Technical Article Writer: Sanjay Mishra Contributors: Marcel van der Holst, Peter Carlin, Sunil Agarwal Technical Reviewer: Stuart Ozer, Lindsey Allen, Juergen Thomas, Thomas Kejser, Burzin Patel, Prem Mehra, Joseph Sack, Jimmy May, Cameron Gardiner, Mike Ruthruff, Glenn Berry (SQL Server MVP), Paul S Randal (SQLskills.com), [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7162&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Data Compression: Strategy, Capacity Planning and Best Practices<br />
SQL Server Technical Article<br />
Writer: Sanjay Mishra<br />
Contributors: Marcel van der Holst, Peter Carlin, Sunil Agarwal<br />
Technical Reviewer: Stuart Ozer, Lindsey Allen, Juergen Thomas, Thomas Kejser, Burzin Patel, Prem Mehra, Joseph Sack, Jimmy May, Cameron Gardiner, Mike Ruthruff, Glenn Berry (SQL Server MVP), Paul S Randal (SQLskills.com), David P Smith (ServiceU Corporation)<br />
Published: May 2009</p>
<p style="text-align:justify;">The data compression feature in SQL Server 2008 helps compress the data inside a database, and it can help reduce the size of the database. Apart from the space savings, data compression provides another benefit: Because compressed data is stored in fewer pages, queries need to read fewer pages from the disk, thereby improving the performance of I/O intensive workloads. However, extra CPU resources are required on the database server to compress and decompress the data, while data is exchanged with the application. Therefore, it is important to understand the workload characteristics when deciding which tables to compress.</p>
<p style="text-align:justify;">This white paper provides guidance on the following:</p>
<ul style="text-align:justify;">
<li>How to decide which tables and indexes to compress</li>
<li>How to estimate the resources required to compress a      table</li>
<li>How to reclaim space released by data compression</li>
<li>The performance impacts of data compression on      typical workloads</li>
</ul>
<p style="text-align:justify;"><strong><a href="http://technet.microsoft.com/en-us/library/dd894051.aspx" target="_blank">Read Whitepaper: Data Compression Strategy Capacity Planning and Best Practices</a></strong></p>
<p style="text-align:justify;">Abstract courtesy : Microsoft</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Data Storage, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, SQLAuthority News, T SQL, Technology Tagged: Compression <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=7162&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/11/07/sqlauthority-news-data-compression-strategy-capacity-planning-and-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Mirrored Backup and Restore and Split File Backup</title>
		<link>http://blog.sqlauthority.com/2009/09/02/sql-server-mirrored-backup-and-restore-and-split-file-backup-2/</link>
		<comments>http://blog.sqlauthority.com/2009/09/02/sql-server-mirrored-backup-and-restore-and-split-file-backup-2/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:30:16 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6660</guid>
		<description><![CDATA[Introduction This article is based on a real life experience of the author while working with database backup and restore during his consultancy work for various organizations. We will go over the following important concepts of database backup and restore. Conventional Backup and Restore Spilt File Backup and Restore Mirror File Backup Understanding FORMAT Clause [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6660&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 style="text-align:justify;">Introduction</h3>
<p style="text-align:justify;">This article is based on a real life experience of the author while working with database backup and restore during his consultancy work for various organizations. We will go over the following important concepts of database backup and restore.</p>
<ol style="text-align:justify;">
<li>Conventional Backup and Restore</li>
<li>Spilt File Backup and Restore</li>
<li>Mirror File Backup</li>
<li>Understanding FORMAT Clause</li>
<li>Miscellaneous details about Backup and Restore</li>
</ol>
<div style="text-align:justify;"><strong>Note: </strong>Before running all the examples, make sure that you have the required folders created on your drive. It is mandatory to create Backup folders prior to creating backup files using SQL Server.</div>
<p style="text-align:justify;">In our example, we will require the following folders:</p>
<ul style="text-align:justify;">
<li>C:\Backup\SingleFile</li>
<li>C:\Backup\MultiFile</li>
<li>C:\Backup\MirrorFile</li>
</ul>
<h3 style="text-align:justify;">Conventional and Split File Backup and Restore</h3>
<p style="text-align:justify;">Just a day before working on one of the projects, I had to take a backup of one database of 14 GB. My hard drive lacked sufficient space at that moment. Fortunately, I had two 8 GB USB Drives with me. Now, the question was how to take a backup in two equal sizes, each of 7 GB, so I can fit them on each USB drive. Well, conventional backup takes one large backup in one file. However, SQL Server backup command can take backups in two or more split parts.</p>
<p style="text-align:justify;">Let us see an example of a conventional one-file backup using the AdventureWorks database.</p>
<div id="highlighter_735873" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BACKUP DATABASE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\SingleFile\AdventureWorks.bak'<br />
</span><span style="color:black;">GO </span></code></div>
<p style="text-align:justify;">The result is displayed below. Here, the backup is taken in a single file.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup1.jpg" alt="" /></p>
<p style="text-align:justify;">Now, let us see how we can split one database into two different database files. This method is very similar to taking a single-file backup. By simply adding an additional DISK option we can split the files backup files.</p>
<div id="highlighter_539944" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BACKUP DATABASE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks1.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks2.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks3.bak'<br />
</span><span style="color:black;">GO<br />
</span></code></div>
<p style="text-align:justify;">In the previous example, we can clearly see that backup is split into three equal parts of the original backup file size.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup2.jpg" alt="" /></p>
<p style="text-align:justify;">Restoring a backup from a single-file backup is quite easy. Let us go over an example where we restore the AdventureWorks database from a single backup file.</p>
<div id="highlighter_977297" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">RESTORE DATABASE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">FROM DISK = </span><span style="color:red;">'C:\Backup\SingleFile\AdventureWorks.bak'<br />
</span><span style="color:black;">GO<br />
</span></code></div>
<p style="text-align:justify;">Running the above script will give a successful message.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup3.jpg" alt="" /></p>
<p style="text-align:justify;">Now let us see an example where we restore a database from a split file. This method is very similar to restoring a database from a single file; just add an additional DISK option.</p>
<div id="highlighter_737278" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">RESTORE DATABASE </span><span style="color:black;">[AdventureWorks]<br />
</span><span style="color:blue;">FROM DISK = </span><span style="color:red;">N'C:\Backup\MultiFile\AdventureWorks1.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">N'C:\Backup\MultiFile\AdventureWorks2.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">N'C:\Backup\MultiFile\AdventureWorks3.bak'<br />
</span><span style="color:black;">GO </span></code></div>
<p style="text-align:justify;">Running the above script will give a successful message as shown in the image below.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup4.jpg" alt="" /></p>
<p style="text-align:justify;">Make sure that while restoring database, the database is not in use, otherwise it will give an error of database in use. In the event of an error taking place, close all the connections and re-attempt to restore the database.</p>
<h3 style="text-align:justify;">Mirror Backup of the file</h3>
<p style="text-align:justify;">It is quite a common practice to create an exact copy of the backup and store it to several places to deal with any catastrophes which might affect the place where the database is stored. Once a full backup is accomplished DBAs generally copy the database to another location in their network using a third party tools like <em>robocopy </em> or native DOS commands like xcopy.</p>
<p style="text-align:justify;">In SQL Server 2005 and later versions, there is a Mirror command that makes a copy of the database backup to different locations while taking the original backup. The maximum limit of additional locations that can be specified with MIRROR clause is 3.</p>
<p style="text-align:justify;">Mirrored backup can be taken in local computer system as well as in a local network. Let us now see two examples of mirror backup.</p>
<h4 style="text-align:justify;">Example 1. Single File Backup to Multiple Locations using Mirror</h4>
<div id="highlighter_236370" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BACKUP DATABASE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\SingleFile\AdventureWorks.bak'<br />
</span><span style="color:black;">MIRROR </span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\MirrorFile\AdventureWorks.bak'<br />
</span><span style="color:blue;">WITH </span><span style="color:black;">FORMAT<br />
GO<br />
</span></code></div>
<p style="text-align:justify;">If this command is being run for the first time, it is mandatory to use the <code>WITH FORMAT </code> clause; but for sub sequential runs it is not required. <code>WITH FORMAT </code> reinitializes the backup.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup5.jpg" alt="" /></p>
<p style="text-align:justify;">When checked in both the folders ‘SingleFile’ and ‘MirrorFile’, backup files are exactly the same files. As mentioned earlier, four mirror backup can be specified in total.</p>
<h4 style="text-align:justify;">Example 2. Split File Backup to Multiple Locations using Mirror</h4>
<p style="text-align:justify;">We have earlier seen an example where we can have multiple split files of large database backup files. SQL Server Mirror functionality also supports backup of the split files.</p>
<div id="highlighter_897158" style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BACKUP DATABASE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks1.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks2.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MultiFile\AdventureWorks3.bak'<br />
</span><span style="color:black;">MIRROR </span><span style="color:blue;">TO DISK = </span><span style="color:red;">'C:\Backup\MirrorFile\AdventureWorks1.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MirrorFile\AdventureWorks2.bak'</span><span style="color:gray;">,<br />
</span><span style="color:blue;">DISK = </span><span style="color:red;">'C:\Backup\MirrorFile\AdventureWorks3.bak'<br />
</span><span style="color:blue;">WITH </span><span style="color:black;">FORMAT<br />
GO<br />
</span></code></div>
<p style="text-align:justify;">All the mirror sets will need the same number of <code>DISK </code> clauses as the original backup media.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup6.jpg" alt="" /></p>
<p style="text-align:justify;">Mirrored database backup can be restored using the same method as the original backup. Mirrored backup is in fact an exact replica of the original backup.</p>
<h3 style="text-align:justify;">Understanding the FORMAT Clause</h3>
<p style="text-align:justify;">The <code>FORMAT </code> clause is used to reinitiate a backup media. Although it is a very useful clause it should be used with caution. When the clause is used it erases everything present in backup media. I have noticed that some DBAs are confused while taking a backup on a local disk where they have SQL Server installed. They have a misconception that if the format command is used, it will erase the complete disk including the SQL Server installation. However, the fact is that SQL Server format clause is quite different from OS format. The effect of SQL Server format clause is limited to a folder or path specified in the <code>DISK </code> clause.</p>
<p style="text-align:justify;">In our example, when the <code>FORMAT </code> clause is specified, it will format only folders like C:\Backup\MultiFile\ or C:\Backup\SingleFile.</p>
<h3 style="text-align:justify;">Related Errors</h3>
<h4 style="text-align:justify;"><strong><span style="color:#ff0000;">Error 3010<em><br />
Invalid backup mirror specification. All mirrors must have the same number of members.</em></span></strong></h4>
<p style="text-align:justify;">This error can show up while taking a mirrored database backup along with a regular backup; and <code>DISK </code> and <code>MIRROR TO DISK </code> do not match accurately.</p>
<p style="text-align:justify;">The following image demonstrates how the error takes place.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup7.jpg" alt="" /></p>
<p style="text-align:justify;">To fix the error, match the members of <code>DISK </code> and <code>MIRROR TO DISK </code> to each other.</p>
<p style="text-align:justify;"><img src="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup8.jpg" alt="" /></p>
<h4 style="text-align:justify;"><span style="color:#ff0000;">Error 3215<em><br />
Use WITH FORMAT to create a new mirrored backup set</em></span></h4>
<p style="text-align:justify;">This error can spring up when a new backup is initiated and an existing media header needs to be reset for all headers on the backup media. If there is already a backup on the media, it will display this error and prevent backup from being overwritten. To fix this error, use <code>WITH FORMAT </code> as shown in an earlier example.</p>
<h3 style="text-align:justify;">Miscellaneous details about Backup and Restore</h3>
<p style="text-align:justify;">When no options are specified, <code>BACKUP DATABASE </code> takes only full backups. Before taking the first log backup, full database backup is necessary to take one full backup. Backups created on later versions of SQL Server cannot be restored to earlier versions of SQL Server. The user needs permissions of <code>sysadmin </code> or <code>db_owner </code> or <code>db_backupoperator </code> roles to perform backup operation.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>),</strong> <a href="http://dotnetslackers.com/articles/sql/Mirrored-Backup-and-Restore-and-Split-File-Backup.aspx" target="_blank">DNS</a></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6660/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6660&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/09/02/sql-server-mirrored-backup-and-restore-and-split-file-backup-2/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup2.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup3.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup4.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup5.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup6.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup7.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/sqlmirror/sql-mirrored-backup8.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Introduction to SQL Azure</title>
		<link>http://blog.sqlauthority.com/2009/08/27/sql-server-introduction-to-sql-azure/</link>
		<comments>http://blog.sqlauthority.com/2009/08/27/sql-server-introduction-to-sql-azure/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 01:30:39 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Documentation]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6657</guid>
		<description><![CDATA[What is SQL Azure? In short, SQL Azure is simply a Microsoft branding change. SQL Services and SQL Data Services are now known as Microsoft SQL Azure and SQL Azure Database. There are a few changes, but fundamentally Microsoft’s plans to extend SQL server capabilities in cloud as web-based services remain intact. SQL Azure will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6657&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 style="text-align:justify;">What is SQL Azure?</h3>
<p style="text-align:justify;">In short, SQL Azure is simply a Microsoft branding change. SQL Services and SQL Data Services are now known as Microsoft SQL Azure and SQL Azure Database. There are a few changes, but fundamentally Microsoft’s plans to extend SQL server capabilities in cloud as web-based services remain intact. SQL Azure will continue to deliver an integrated set of services for relational databases. The reporting, analytics and data synchronization with end-users and partners also remains unchanged. This makes it most appealing to current users of SQL Server.</p>
<p style="text-align:justify;">SQL Azure is going to be the Next Big Thing from Microsoft. It is just giving SQL Server a new way of doing operations it was doing for long time. Being on cloud, it keeps development relatively simple by keeping the heart of the programming almost the same. Additionally, SQL Azure keeps the goals of SQL Server, i.e. high availability, scalability and security in the core.</p>
<p style="text-align:justify;">Developers can just start developing SQL Azure application locally using SQL Server Express version (<a rel="nofollow" href="http://www.microsoft.com/express/sql/download/">http://www.microsoft.com/express/sql/download/),</a> or the CTP version that will be available in August.</p>
<p style="text-align:justify;"><strong><a href="http://dotnetslackers.com/articles/sql/Introduction-to-SQL-Azure.aspx" target="_blank">Read my complete article here.</a></strong></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Azure, SQL Data Storage, SQL Documentation, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Cloud Computing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6657/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6657&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/27/sql-server-introduction-to-sql-azure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; SQL Server Express &#8211; A Complete Reference Guide</title>
		<link>http://blog.sqlauthority.com/2009/08/26/sql-server-sql-server-express-a-complete-reference-guide/</link>
		<comments>http://blog.sqlauthority.com/2009/08/26/sql-server-sql-server-express-a-complete-reference-guide/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 01:30:26 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL Server Express]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6664</guid>
		<description><![CDATA[SQL Server Express is one of the most valuable products of Microsoft. Very often, I face many questions with regard to SQL Server Express. Today, we will be covering some of the most commonly asked questions. Q: What is the cost of SQL Server Express? A: SQL Server Express is a FREE product from Microsoft. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6664&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">
<p style="text-align:justify;">SQL Server Express is one of the most valuable products of Microsoft. Very often, I face many questions with regard to SQL Server Express. Today, we will be covering some of the most commonly asked questions.</p>
<p style="text-align:justify;">Q: What is the cost of SQL Server Express?<br />
A: SQL Server Express is a<strong> FREE</strong> product from Microsoft.</p>
<p style="text-align:justify;">Q: Where can I find more details about SQL Server Express?<br />
A: On official Microsoft Site:<a href="http://www.microsoft.com/express/sql/default.aspx" target="_blank"> http://www.microsoft.com/express/sql/default.aspx</a></p>
<p style="text-align:justify;">Q: Why should I use SQL Server Express when I have full version available?<br />
A: Usually, I install only the license version product on my system. When I do not have to use all the features of SQL Server, I install SQL Server Express.</p>
<p style="text-align:justify;">Q: What is the maximum size per database for SQL Server Express?<br />
A: SQL Server Express supports a maximum size of 4 GB per database, which excludes all the log files. 4 GB is not a very large size; however, if database is properly designed and the tables are properly arranged in a separate database, this limitation can be resolved to a certain extent.<a href="#_msocom_2"></a></p>
<p style="text-align:justify;">Q: Can MySQL be compared with SQL Server Express as both of them are free products?<br />
A: Yes. Both are free and have their own space. However, thus far, I have never faced a situation wherein the task that can be accomplished by using MySQL is not accomplished by SQL Server Express.</p>
<p style="text-align:justify;">Q: Does SQL Server have sufficient help available online?<br />
A: Yes. There are so many online help resources available for SQL Server Express that user will find strongest community for any FREE product.
</p>
<p style="text-align:justify;">Let me give you quick list of the online help resources. Even though I took some time to build this reference list, I am sure that all of you will appreciate this and will share with others, which is worth the effort!</p>
<p style="text-align:justify;"><strong>Overview</strong></p>
<ul style="text-align:justify;">
<li><a href="http://www.microsoft.com/sql/techinfo/whitepapers/sql2008Overview.mspx" target="_blank">SQL Server 2008 Product Overview</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms345154.aspx" target="_blank">SQL Server 2005 Express Edition Overview</a></li>
<li><a href="http://msdn2.microsoft.com/hi-in/express/aa718379.aspx" target="_blank">SQL Server Express Edition Comparison</a></li>
</ul>
<p style="text-align:justify;"><strong>Getting Started</strong></p>
<p style="text-align:justify;"><strong>Installation</strong></p>
<ul style="text-align:justify;">
<li><a href="http://msdn2.microsoft.com/hi-in/express/bb410792.aspx" target="_blank">Downloading SQL Server2005 SP2 Express Edition</a></li>
<li><a href="http://download.microsoft.com/download/f/1/0/f10c4f60-630e-4153-bd53-c3010e4c513b/RequirementsSQLEXP2005.htm" target="_blank">Installation Requirements for SQL Server Express</a></li>
<li><a href="http://download.microsoft.com/download/E/8/B/E8B42814-6A0C-40EB-911F-E7ADEC87F5D5/UpgrExptoWkgStd.doc" target="_blank">Upgrading from SQL Server 2005 Express Edition to Workgroup or Standard Editions</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms143441.aspx" target="_blank">Installing SQL Server Express Edition</a></li>
<li><a href="http://www.microsoft.com/sql/editions/express/redistregister.mspx" target="_blank">Building and shipping applications using SQL Server Express 2005</a></li>
</ul>
<p style="text-align:justify;"><strong>Quick Start</strong></p>
<ul style="text-align:justify;">
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165612.aspx" target="_blank">Getting Started &#8211; How To: SQL Server Express</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165732.aspx" target="_blank">Walkthrough: Creating an Application by Using SQL Server Express and Visual Web Developer 2005 Express</a></li>
<li><a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx" target="_blank">Managing SQL Server Express Edition with Management Studio Express</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/bb264564.aspx" target="_blank">SQL Server 2005 Express Edition User Instances</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165702.aspx" target="_blank">Using the sqlcmd Utility (SQL Server Express)</a></li>
<li><a href="http://support.microsoft.com/kb/325003" target="_blank">How to manage the SQL Server Desktop Engine (MSDE 2000) or SQL Server 2005 Express Edition by using the osql utility</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165639.aspx" target="_blank">Distributing SQL Server Express</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms365166.aspx" target="_blank">Reporting Services in SQL Server 2005 Express Edition with Advanced Services</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165673.aspx" target="_blank">How to: Attach a Database File to SQL Server Express</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165700.aspx" target="_blank">Replication in SQL Server Express</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/Bb264562.aspx" target="_blank">Embedding SQL Server Express into Custom Applications</a></li>
</ul>
<p style="text-align:justify;"><strong>Misc</strong></p>
<ul style="text-align:justify;">
<li><a href="http://members.microsoft.com/CustomerEvidence/search/AdvancedSearchResults.aspx?Flag=0&amp;Keyword=sql%20server%202005%20express" target="_blank">View SQL Server Express Edition Case Studies</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms165726.aspx" target="_blank">SQL Server Express Developer Infocenter</a></li>
<li><a href="http://support.microsoft.com/kb/322336" target="_blank">How to verify and change the system administrator password in MSDE or SQL Server 2005 Express Edition</a></li>
<li><a href="http://support.microsoft.com/kb/914278" target="_blank">How SQL Server 2005 Express Edition determines the CPU count and uses the CPUs during processing</a></li>
<li><a href="http://support.microsoft.com/kb/319930" target="_blank">How to connect to an instance of SQL Server Desktop Edition or of SQL Server 2005 Express Edition</a></li>
<li><a href="http://support.microsoft.com/kb/912426" target="_blank">How to detect the status of the SQL Server Express service or start the SQL Server Express service by using Visual Basic or Visual C#</a></li>
<li><a href="http://support.microsoft.com/kb/916784" target="_blank">How to perform full-text search related tasks in SQL Server 2005 Express Edition with Advanced Services</a></li>
</ul>
<p style="text-align:justify;"><strong>Blogs</strong></p>
<ul style="text-align:justify;">
<li><a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&amp;SiteID=1" target="_blank">SQL Server Express &#8211; MSDN Forums</a></li>
<li><a href="http://blogs.msdn.com/sqlexpress" target="_blank">Blogs: SQL Server Express WebLog</a></li>
</ul>
<p style="text-align:justify;"><strong>Webcasts</strong></p>
<ul style="text-align:justify;">
<li><a href="http://msdn2.microsoft.com/hi-in/express/aa718391.aspx" target="_blank">8-Part series of Webcasts over SQL Server Express Edition</a></li>
<li><a href="http://msevents.microsoft.com/cui/webcasteventdetails.aspx?eventid=1032271510&amp;eventcategory=3&amp;culture=en-us&amp;countrycode=us" target="_blank">Using Service Broker in SQL Server 2005 Express Edition for Reliable Service-Oriented Architecture (SOA) Implementations (Level 300)</a></li>
<li><a href="http://msevents.microsoft.com/cui/webcasteventdetails.aspx?eventid=1032271453&amp;eventcategory=3&amp;culture=en-us&amp;countrycode=us" target="_blank">Introducing SQL Server 2005 Express Edition: Your Smart Client Data Store (Level 200)</a></li>
<li><a href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032280289&amp;EventCategory=5&amp;culture=en-US&amp;CountryCode=US" target="_blank">TechNet Webcast: SQL Server 2005 Express Edition (Level 200)</a></li>
</ul>
<p style="text-align:justify;"><strong><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=c7933d3e-b7b9-43a6-ade3-f8e37c8cb046" target="_blank"></a></strong></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Data Storage, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: MySQL, SQL Server Express <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6664/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6664&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/26/sql-server-sql-server-express-a-complete-reference-guide/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Introduction to Change Data Capture (CDC) in SQL Server 2008</title>
		<link>http://blog.sqlauthority.com/2009/08/15/sql-server-introduction-to-change-data-capture-cdc-in-sql-server-2008/</link>
		<comments>http://blog.sqlauthority.com/2009/08/15/sql-server-introduction-to-change-data-capture-cdc-in-sql-server-2008/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 01:30:46 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6599</guid>
		<description><![CDATA[Simple-Talk.com has published my very first article on their site. This article is introducing Change Data Capture &#8211; the new concept introduced in SQL Server 2008. Change Data Capture records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables, and makes a record available of what changed, where, and when, in simple relational &#8216;change tables&#8217; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6599&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><strong>Simple-Talk.com</strong> has published my very first article on their site. This article is introducing Change Data Capture &#8211; the new concept introduced in SQL Server 2008. Change Data Capture records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables, and makes a record available of what changed, where, and when, in simple relational &#8216;change tables&#8217; rather than in an esoteric chopped salad of XML. These change tables contain columns that reflect the column structure of the source table you have chosen to track, along with the metadata needed to understand the changes that have been made.</p>
<p style="text-align:justify;"><a href="http://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-%28cdc%29-in-sql-server-2008/" target="_blank">Introduction to Change Data Capture (CDC) in SQL Server 2008</a></p>
<p style="text-align:justify;">Please read my article and leave your valuable comments here. If you like the article do not forget to rate it.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
<p style="text-align:justify;">
<br />Posted in Database, Pinal Dave, SQL, SQL Authority, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6599/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=6599&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/15/sql-server-introduction-to-change-data-capture-cdc-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Four Different Ways to Find Recovery Model for Database</title>
		<link>http://blog.sqlauthority.com/2009/07/16/sql-server-four-different-ways-to-find-recovery-model-for-database/</link>
		<comments>http://blog.sqlauthority.com/2009/07/16/sql-server-four-different-ways-to-find-recovery-model-for-database/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 01:30:26 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5915</guid>
		<description><![CDATA[Perhaps, the best thing about technical domain is that most of the things can be executed in more than one ways. It is always useful to know about the various methods of performing a single task. Today, we will observe four different ways to find out recovery model for any database. Method 1 Right Click [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5915&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Perhaps, the best thing about technical domain is that most of the things can be executed in more than one ways. It is always useful to know about the various methods of performing a single task. Today, we will observe four different ways to find out recovery model for any database.</p>
<p style="text-align:justify;"><strong>Method 1</strong></p>
<p style="text-align:justify;">Right Click on Database &gt;&gt; Go to Properties &gt;&gt; Go to Option. On the Right side you can find recovery model.</p>
<p style="text-align:justify;"><strong>Method 2</strong></p>
<p style="text-align:justify;">Click on the Database Node in Object Explorer. In Object Explorer Details, you can see the column Recovery Model.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/rm2.jpg" alt="" width="500" height="290" /></p>
<p style="text-align:justify;"><strong>Method 3</strong></p>
<p style="text-align:justify;">This is a very easy method and it gives all the database information in one script.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">name </span><span style="color:blue;">AS </span><span style="color:black;">[Database Name]</span><span style="color:gray;">,<br />
</span><span style="color:black;">recovery_model_desc </span><span style="color:blue;">AS </span><span style="color:black;">[Recovery Model]<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.databases<br />
GO</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/rm3.jpg" alt="" width="417" height="454" /></p>
<p style="text-align:justify;"><strong>Method 4</strong></p>
<p style="text-align:justify;">This method provides only one database at a time.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:red;">'ADVENTUREWORKS' </span><span style="color:blue;">AS </span><span style="color:black;">[Database Name]</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">DATABASEPROPERTYEX</span><span style="color:gray;">(</span><span style="color:red;">'ADVENTUREWORKS'</span><span style="color:gray;">, </span><span style="color:red;">'RECOVERY'</span><span style="color:gray;">)<br />
</span><span style="color:blue;">AS </span><span style="color:black;">[Recovery Model]<br />
GO</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/rm4.jpg" alt="" width="489" height="187" /></p>
<p style="text-align:justify;"><strong>My recommendation </strong></p>
<p>Of all the above methods, I prefer Method 3. It is accurate and can be used in T-SQL code. Besides, I can use it for many other purposes as well.</p>
<p>I would like to know which one is your favorite method .</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5915/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5915/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5915/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5915&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/07/16/sql-server-four-different-ways-to-find-recovery-model-for-database/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/rm2.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/rm3.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/rm4.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Restore Sequence and Understanding NORECOVERY and RECOVERY</title>
		<link>http://blog.sqlauthority.com/2009/07/15/sql-server-restore-sequence-and-understanding-norecovery-and-recovery/</link>
		<comments>http://blog.sqlauthority.com/2009/07/15/sql-server-restore-sequence-and-understanding-norecovery-and-recovery/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 01:30:29 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5895</guid>
		<description><![CDATA[I maintain a spreadsheet of questions sent by users and from that I single out a topic to write and share my knowledge and opinion. Unless and until I find an issue appealing, I do not prefer to write about it, till the issue crosses the threshold. Today the question that crossed the threshold is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5895&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I maintain a spreadsheet of questions sent by users and from that I single out a topic to write and share my knowledge and opinion. Unless and until I find an issue appealing, I do not prefer to write about it, till the issue crosses the threshold. Today the question that crossed the threshold is &#8211; <strong>what is the difference between NORECOERY and RECOVERY when restoring database.</strong></p>
<p style="text-align:justify;">The fact is that one can easily go to MSDN and learn the difference, so I head myself to MSDN and read the difference. This is what the Book On Line suggests <a href="http://msdn.microsoft.com/en-us/library/ms186858.aspx" target="_blank">here</a>.</p>
<p style="padding-left:60px;text-align:justify;"><em><strong> </strong></em></p>
<p style="padding-left:60px;text-align:justify;"><em>NORECOVERY specifies that roll back not occur. This allows roll forward to continue with the next statement in the sequence.<br />
In this case, the restore sequence can restore other backups and roll them forward.<br />
RECOVERY (the default) indicates that roll back should be performed after roll forward is completed for the current backup.<br />
Recovering the database requires that the entire set of data being restored (the roll forward set) is consistent with the database. If the roll forward set has not been rolled forward far enough to be consistent with the database and RECOVERY is specified, the Database Engine issues an error.</em>
</p>
<p style="text-align:justify;">Book On Line has very clearly explained the same subject and provides succinct explanation of the difference.</p>
<p style="text-align:justify;">In other words -</p>
<p style="text-align:justify;"><em><strong>While doing RESTORE Operation if you restoring database files, always use NORECOVER option as that will keep database in state where more backup file are restored. This will also keep database offline also to prevent any changes, which can create itegrity issues. Once all backup file is restored run RESTORE command with RECOVERY option to get database online and operational.</strong></em></p>
<p style="text-align:justify;">It is also important to be acquainted with the restore sequence of how full database backup is restored.</p>
<p style="text-align:justify;">First, restore full database backup, differential database backup and all transactional log backups WITH NORECOVERY Option. After that, bring back database online using WITH RECOVERY option.</p>
<p style="text-align:justify;">Following is the sample Restore Sequence</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">RESTORE DATABASE DATABASE FROM </span><span style="color:black;">full_database_backup </span><span style="color:blue;">WITH </span><span style="color:black;">NORECOVERY</span><span style="color:gray;">;<br />
</span><span style="color:blue;">RESTORE DATABASE DATABASE FROM </span><span style="color:black;">differential_backup </span><span style="color:blue;">WITH </span><span style="color:black;">NORECOVERY</span><span style="color:gray;">;<br />
</span><span style="color:blue;">RESTORE </span><span style="color:magenta;">LOG </span><span style="color:blue;">DATABASE FROM </span><span style="color:black;">log_backup </span><span style="color:blue;">WITH </span><span style="color:black;">NORECOVERY</span><span style="color:gray;">;<br />
</span><span style="color:green;">-- Repeat this till you restore last log backup<br />
</span><span style="color:blue;">RESTORE DATABASE DATABASE WITH </span><span style="color:black;">RECOVERY</span><span style="color:gray;">;</span></code>
</p>
<p style="text-align:justify;">I hope now it is very clear to you all what is restore sequence and the difference between recovery options.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Posted in Pinal Dave, Readers Question, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5895/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5895&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/07/15/sql-server-restore-sequence-and-understanding-norecovery-and-recovery/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; BLOB &#8211; Pointer to Image, Image in Database, FILESTREAM Storage</title>
		<link>http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/</link>
		<comments>http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 01:30:54 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5823</guid>
		<description><![CDATA[When it comes to storing images in database there are two common methods. I had previously blogged about the same subject on my visit to Toronto. With SQL Server 2008, we have a new method of FILESTREAM storage. However, the answer on when to use FILESTREAM and when to use other methods is still vague [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5823&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">When it comes to storing images in database there are two common methods. I had previously blogged about the same subject on <a href="http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/" target="_blank">my visit to Toronto</a>. With SQL Server 2008, we have a new method of FILESTREAM storage. However, the answer on when to use FILESTREAM and when to use other methods is still vague in community.</p>
<p style="text-align:justify;">Let us look into two traditional methods first along with their advantage and disadvantages.</p>
<p style="text-align:justify;"><strong>Method 1) Store image in filesystem and store pointer in database</strong></p>
<p style="text-align:justify;">This is quite an old method and you can find this implemented in many places, even though SQL Server 2005 has been released 5 years ago.<br />
The advantage of this method is that there is no limit on the size of images file and it is the fastest way to retrieve images from system.<br />
The drawback of this method is that application and database security acts separately and application/OS has to take backup for images.
</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><strong>Method 2) Store images in a database</strong><br />
This was introduced in SQL Server 2005 where images (binary data) can be stored in database.<br />
The advantage of this method is same as the disadvantages of method 1, i.e. security and permissions.<br />
The disadvantage of this method is same as the advantages of method 1, i.e. speed and maximum size is limited to 2 GB.
</p>
<p style="text-align:justify;">On observing Method 1 and Method 2, it is very clear that they are complementing each other but both are very powerful methods on their own.</p>
<p style="text-align:justify;">Although both the methods are very good they have limitations, which together only they can provide. This is where FILESTREAM Storage comes into action.</p>
<p style="text-align:justify;">FILESTREAM Storage system can store BLOB (Binary Large Object OBject) or images file, which is larger than 2 GB, and it can store them in database itself. It can be backed up just like regular database backup, and the security of the BLOB is maintained along with database application. After all this, it is as fast as filesystem. Now, this is what makes this superior to any other methods described earlier.</p>
<p style="text-align:justify;"><strong>Summary: We can use FILESTREAM Storage to overcome traditional limitations of SQL Server storage of BLOB, varbinary or images.</strong></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Data Storage, SQL Query, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5823/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5823&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Standby Servers and Types of Standby Servers</title>
		<link>http://blog.sqlauthority.com/2009/07/11/sql-server-standby-servers-and-types-of-standby-servers/</link>
		<comments>http://blog.sqlauthority.com/2009/07/11/sql-server-standby-servers-and-types-of-standby-servers/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 01:30:32 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5849</guid>
		<description><![CDATA[Standby servers - Standby Server is a type of server that can be brought online in a situation when Primary Server goes offline and application needs continuous (high) availability of the server. There is always a need to set up a mechanism where data and objects from primary server are moved to secondary (standby) server. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5849&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><strong>Standby servers </strong>- Standby Server is a type of server that can be brought online in a situation when Primary Server goes offline and application needs continuous (high) availability of the server. There is always a need to set up a mechanism where data and objects from primary server are moved to secondary (standby) server. This mechanism usually involves the process of moving backup from the primary server to the secondary server using T-SQL scripts. Often, database wizards are used to set up this process.</p>
<p style="text-align:justify;">We will now glance at the various types of standby servers.</p>
<p style="text-align:justify;"><strong>Hot Standby</strong> &#8211; Hot Standby can be achieved in SQL Server using SQL Server 2005 Enterprise Edition and the later enterprise versions. SQL Server 2005 has introduced Mirroring of database that can be configured for automatic failover in a disaster situation. In the case of synchronous mirroring database is replicated to both the servers simultaneously.  This is a little expensive but provides the best high availability. In this case, both primary and standby servers have same data all the time.</p>
<p style="text-align:justify;"><strong>Warm Standby</strong> – In Warm Standby automatic failover is not configured. This is usually set up using Log Shipping or asynchronous mirroring. Sometimes warm standby is lagging by a few minutes or seconds, which results into loss of few latest updates when primary server fails and newer server needs to be failed over. Sometimes warm server that is lagging by a few transactions is brought back to the current state by applying recent transaction log.</p>
<p style="text-align:justify;"><strong>Cold Standby</strong> &#8211; Code Standby servers need to be switched manually, and sometimes all the backups as well as the required OS need to be applied. Cold Standby  just physically replaces the previous server.</p>
<p style="text-align:justify;">I am curious to know what do you all think about this these three types of standby servers. I am eager to know what kind of server setup you have at your workplace. If you can share these details, it will be very useful to all the readers. If I find your information interesting, I will create a new blog post with due credit to you.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5849/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5849/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5849/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=5849&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/07/11/sql-server-standby-servers-and-types-of-standby-servers/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Restore or Attach Database Without .NDF or .MDF is Not Possible</title>
		<link>http://blog.sqlauthority.com/2009/04/10/sql-server-restore-or-attach-database-without-ndf-or-mdf-is-not-possible/</link>
		<comments>http://blog.sqlauthority.com/2009/04/10/sql-server-restore-or-attach-database-without-ndf-or-mdf-is-not-possible/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 01:30:57 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4271</guid>
		<description><![CDATA[This article revolves around a trivial yet common issue. There might be a set of people for whom the current topic might appear to be insignificant. But I have been asked this question innumerable times, particularly from   people who are frequenting using forums or have blog related to storage and highly availability, which instigated me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=4271&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">This article revolves around a trivial yet common issue. There might be a set of people for whom the current topic might appear to be insignificant. But I have been asked this question innumerable times, particularly from   people who are frequenting using forums or have blog related to storage and highly availability, which instigated me to write this article.</p>
<p style="text-align:justify;">Here goes this frequently asked question.</p>
<p style="text-align:justify;"><strong>Question:</strong> Is it possible to restore database if one of the files of .mdf (primary data file) or .ndf (secondary data file) is missing?</p>
<p style="text-align:justify;"><strong>Answer:</strong> In one word the answer is <strong>NO</strong>. All the .mdf and .ndf files are mandatory to attach or restore database successfully.  Even though  you have all the transactions stored in .ldf you will not be able to restore the database completely.</p>
<p>I hope this answer removes the cloud of doubt hovering over my targeted readers.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<p style="text-align:justify;">
<br />Posted in Database, Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4271/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=4271&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/10/sql-server-restore-or-attach-database-without-ndf-or-mdf-is-not-possible/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Mirrored Backup and Restore and Split File Backup</title>
		<link>http://blog.sqlauthority.com/2009/04/05/sql-server-mirrored-backup-and-restore-and-split-file-backup/</link>
		<comments>http://blog.sqlauthority.com/2009/04/05/sql-server-mirrored-backup-and-restore-and-split-file-backup/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:30:04 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4670</guid>
		<description><![CDATA[Introduction This article is based on a real life experience of the author while working with database backup and restore during his consultancy work for various organizations. We will go over the following important concepts of database backup and restore. Conventional Backup and Restore Spilt File Backup and Restore Mirror File Backup Understanding FORMAT Clause [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=4670&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 style="text-align:justify;">Introduction</h3>
<p style="text-align:justify;">This article is based on a real life experience of the author while working with database backup and restore during his consultancy work for various organizations. We will go over the following important concepts of database backup and restore.</p>
<ol style="text-align:justify;">
<li>Conventional Backup and Restore</li>
<li>Spilt File Backup and Restore</li>
<li>Mirror File Backup</li>
<li>Understanding FORMAT Clause</li>
<li>Miscellaneous details about Backup and Restore</li>
</ol>
<h3 style="text-align:justify;">Conventional and Split File Backup and Restore</h3>
<p style="text-align:justify;">Just a day before working on one of the projects, I had to take a backup of one database of 14 GB. My hard drive lacked sufficient space at that moment. Fortunately, I had two 8 GB USB Drives with me. Now, the question was how to take a backup in two equal sizes, each of 7 GB, so I can fit them on each USB drive. Well, conventional backup takes one large backup in one file. However, SQL Server backup command can take backups in two or more split parts.</p>
<h3 style="text-align:justify;"><a href="http://dotnetslackers.com/articles/sql/Mirrored-Backup-and-Restore-and-Split-File-Backup.aspx" target="_blank">Read Complete Article here.</a></h3>
<p><strong>Reference : </strong><strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<br />Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4670/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;blog=668536&amp;post=4670&amp;subd=sqlauthority&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/05/sql-server-mirrored-backup-and-restore-and-split-file-backup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
	</channel>
</rss>
