<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title> &#187; DMV</title>
	<atom:link href="http://benchmarkitconsulting.com/tag/dmv/feed/" rel="self" type="application/rss+xml" />
	<link>http://benchmarkitconsulting.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 12:54:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Harder, Better, Faster, Stronger</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:00:16 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[dm_server_services]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[sqlpass]]></category>
		<category><![CDATA[sysprocesses]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1943</guid>
		<description><![CDATA[OK maybe not &#8220;harder&#8221; but I just found a DMV that I didn&#8217;t know existed that is going to help me make &#8220;better, faster, stronger&#8221; an old way of doing things. I wrote a blog post back in 2009 called: Check SQL Server Agent Status on all SQL Servers This scripted used the sysprocesses table [...]]]></description>
			<content:encoded><![CDATA[<p><iframe width="420" height="315" src="http://www.youtube.com/embed/bl6RJyZdBSU" frameborder="0" allowfullscreen></iframe></p>
<p>OK maybe not &#8220;harder&#8221; but I just found a DMV that I didn&#8217;t know existed that is going to help me make &#8220;better, faster, stronger&#8221; an old way of doing things.</p>
<p>I wrote a blog post back in 2009 called: <a href="http://benchmarkitconsulting.com/colin-stasiuk/2009/07/20/check-sql-server-agent-status-on-all-sql-servers/" target="_blank">Check SQL Server Agent Status on all SQL Servers</a></p>
<p>This scripted used the sysprocesses table to check for the existence of a row where the program_name = &#8216;SQLAgent &#8211; Generic Refresher&#8217;.  If the row existed then that told me the SQL Server Agent was up and running.</p>
<p>While poking around SQL 2012 CTP3 I stumbled upon the <a href="http://msdn.microsoft.com/en-us/library/hh204542.aspx" target="_blank">sys.dm_server_services</a> DMV (which basically returns information about the SQL Server and SQL Server Agent services&#8230; information like whether or not they are running <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>I thought I&#8217;d check books online to see if this was something new introduced in SQL 2012 and apparently this has been around since SP1 of SQL 2008 R2.</p>
<p><img class="alignnone size-large wp-image-1944" title="29_01_05_11_8_28_32" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/10/29_01_05_11_8_28_32-1024x454.png" alt="" width="368" height="163" /></p>
<p>Whenever I find something like this and can tweak / fix /modernize something I&#8217;ve used for what seems like forever I feel like I&#8217;m evolving <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you&#8217;d like to chat with me about this or anything else (SQL or other) please leave a comment or hit me up on my Twitter: <a href="http://twitter.com/ColinStasiuk" target="_blank">@ColinStasiuk</a></p>
<p><a href="http://benchmarkitconsulting.com/" target="_blank"><img title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Harder%2C+Better%2C+Faster%2C+Stronger+http://tinyurl.com/3d8mqsr" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Reason SQL 2000 should just go away!   :)</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 21:01:13 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[bitwise]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[log file]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2000]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[Transaction Log]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=785</guid>
		<description><![CDATA[Quick without looking it up&#8230; what does this script do: SELECT * FROM   dbo.sysfiles  WHERE  (status &#38; 0x40) &#60;&#62; 0 So if you&#8217;re like me and don&#8217;t have all the bit compares memorized for all the tables you probably didn&#8217;t know that this is how (in SQL 2000) you would query the current database to find all the transaction log files.  Every now and [...]]]></description>
			<content:encoded><![CDATA[<p>Quick without looking it up&#8230; what does this script do:</p>
<p><code style="font-size: 12px;"><span style="color:blue">SELECT </span><span style="color:gray">*<br />
</span><span style="color:blue">FROM   </span><span style="color:black">dbo.sysfiles <br />
</span><span style="color:blue">WHERE  </span><span style="color:gray">(</span><span style="color:black">status </span><span style="color:gray">&amp; </span><span style="color:black">0x40</span><span style="color:gray">) &lt;&gt; </span><span style="color:black">0</span></code></p>
<p>So if you&#8217;re like me and don&#8217;t have all the bit compares memorized for all the tables you probably didn&#8217;t know that this is how (in SQL 2000) you would query the current database to find all the transaction log files.  </p>
<p>Every now and again I take for granted the major jump that was SQL 2000 to SQL 2005 and little things like this just show me how much happier I am working in a SQL 2005/2008 environment. </p>
<p>Let me channel my inner Naughty By Nature here:</p>
<p>You down with DMV&#8230;. yeah you know me<br />
You down with DMV&#8230; yeah you know me</p>
<p>(Sorry I&#8217;m still hurting from not winning <a href="http://sqlfool.com/2009/06/sql-rap-contest-results/" target="_blank">SQL Fool&#8217;s Rap Contest </a> )</p>
<p><span style="text-decoration: line-through;">DAMN YOU</span>  My humble congratulations to <a href="http://twitter.com/way0utwest" target="_blank">Steve &#8220;Flavor Flav&#8221; Jones</a></p>
<p><img class="alignnone size-full wp-image-786" title="stevejones" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/07/stevejones.jpg" alt="stevejones" width="93" height="223" /></p>
<p>Now if you were to come across this code:</p>
<p><code style="font-size: 12px;"><span style="color:blue">SELECT&nbsp;</span><span style="color:gray">*&nbsp;<br />
<br /></span><span style="color:blue">FROM&nbsp;&nbsp;&nbsp;</span><span style="color:black">sys.database_files<br />
<br /></span><span style="color:blue">WHERE&nbsp;&nbsp;</span><span style="color:black">type_desc&nbsp;</span><span style="color:blue">=&nbsp;</span><span style="color:red">&#39;LOG&#39;<br />
<br /></span></code></p>
<p>Wouldn&#8217;t you have a much better idea as to what the query is trying to accomplish?</p>
<p>Anyways just another (albeit small) reason why I&#8217;m glad to be leaving SQL 2000 in the past.</p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Another+Reason+SQL+2000+should+just+go+away%21+++%3A%29+http://tinyurl.com/m4nn42" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/&amp;title=Another+Reason+SQL+2000+should+just+go+away%21+++%3A%29" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/&amp;title=Another+Reason+SQL+2000+should+just+go+away%21+++%3A%29" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/&amp;title=Another+Reason+SQL+2000+should+just+go+away%21+++%3A%29" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/07/02/another-reason-sql-2000-should-just-go-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL 2008 &#8211; Persisted SKU Features DMV</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 14:15:40 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[dm_db_persisted_sku_features]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=389</guid>
		<description><![CDATA[In my continuing effort to bring forth the lesser known new features in SQL Server 2008 I give to you: sys.dm_db_persisted_sku_features This is great. This new DMV gives you a nice quick view of the features that your database uses that are restricted to only Enterprise or Developer editions of SQL Server. Some examples of [...]]]></description>
			<content:encoded><![CDATA[<p>In my continuing effort to bring forth the lesser known new features in SQL Server 2008 I give to you:</p>
<p><strong>sys.dm_db_persisted_sku_features</strong></p>
<p>This is great. This new DMV gives you a nice quick view of the features that your database uses that are restricted to only Enterprise or Developer editions of SQL Server. Some examples of this (listed in <a href="http://msdn.microsoft.com/en-us/library/cc280724.aspx" target="_blank">BOL</a>) are:</p>
<p><strong>Compression</strong>. Indicates that at least one table or index uses data compression or the vardecimal storage format.</p>
<p><strong>Partitioning</strong>. Indicates that the database contains partitioned tables, partitioned indexes, partition schemes, or partition functions.</p>
<p><strong>TransparentDataEncryption</strong>. Indicates that a database is encrypted by using transparent data encryption.</p>
<p><strong>ChangeCapture</strong>. Indicates that a database has change data capture enabled.</p>
<p>Below is some code to<br />
   Create a Test Database<br />
   SELECT from sys.dm_db_persisted_sku_features<br />
   Enable Change Data Capture<br />
   SELECT from sys.dm_db_persisted_sku_features<br />
   Drop the Test Database</p>
<p><code style="font-size: 12px;"><span style="color: #0000ff;">CREATE DATABASE </span><span style="color: #000000;">TestDatabase<br />
GO<br />
</span><span style="color: #0000ff;">USE </span><span style="color: #000000;">TestDatabase<br />
GO<br />
</span><span style="color: #0000ff;">SELECT </span><span style="color: #808080;">* </span><span style="color: #0000ff;">FROM </span><span style="color: #000000;">sys.dm_db_persisted_sku_features</span><span style="color: #808080;">;<br />
</span><span style="color: #000000;">GO<br />
</span><span style="color: #0000ff;">EXEC </span><span style="color: #000000;">sys.</span><span style="color: #8b0000;">sp_cdc_enable_db<br />
</span><span style="color: #000000;">GO<br />
</span><span style="color: #0000ff;">SELECT </span><span style="color: #808080;">* </span><span style="color: #0000ff;">FROM </span><span style="color: #000000;">sys.dm_db_persisted_sku_features</span><span style="color: #808080;">;<br />
</span><span style="color: #000000;">GO<br />
</span><span style="color: #0000ff;">USE MASTER<br />
</span><span style="color: #000000;">GO<br />
</span><span style="color: #0000ff;">DROP DATABASE </span><span style="color: #000000;">TestDatabase</span></code></p>
<p>So if you&#8217;re looking to backup a database from an Enterprise or Developer instance and restore it to a instance that is not Enterprise or Developer edition have a look at this DMV and potentially save yourself some headaches.</p>
<p>Enjoy!!!</p>
<p><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><br />
<img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" /><br />
</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=SQL+2008+%26%238211%3B+Persisted+SKU+Features+DMV+http://tinyurl.com/c892ar" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/&amp;title=SQL+2008+%26%238211%3B+Persisted+SKU+Features+DMV" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/&amp;title=SQL+2008+%26%238211%3B+Persisted+SKU+Features+DMV" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/&amp;title=SQL+2008+%26%238211%3B+Persisted+SKU+Features+DMV" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/02/04/dmv-sysdm_db_persisted_sku_features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

