<?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>belle's sql musings</title>
	<atom:link href="http://sqlmusings.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlmusings.wordpress.com</link>
	<description>ramblings, discoveries, tutorials on sql server, and other (mostly) database related stuff</description>
	<lastBuildDate>Sat, 19 Mar 2011 06:09:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sqlmusings.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>belle's sql musings</title>
		<link>http://sqlmusings.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sqlmusings.wordpress.com/osd.xml" title="belle&#039;s sql musings" />
	<atom:link rel='hub' href='http://sqlmusings.wordpress.com/?pushpress=hub'/>
		<item>
		<title>i&#8217;ve moved! http://www.sqlmusings.com</title>
		<link>http://sqlmusings.wordpress.com/2009/03/08/ive-moved-httpwwwsqlmusingscom/</link>
		<comments>http://sqlmusings.wordpress.com/2009/03/08/ive-moved-httpwwwsqlmusingscom/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 09:01:02 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/?p=428</guid>
		<description><![CDATA[I&#8217;ve finally done it! I&#8217;ve moved my posts to a new home, new domain. Please check out http://www.sqlmusings.com for the latest posts. And I can tell you right now I will be blogging more often. I think I have 2 months worth of blogs stashed somewhere. Yups, http://www.sqlmusings.com. Promise, it will be a treat Posted [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=428&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally done it! I&#8217;ve moved my posts to a new home, new domain. Please check out <a title="belle's sql musings" href="http://www.sqlmusings.com">http://www.sqlmusings.com</a> for the latest posts. And I can tell you right now I will be blogging more often. I think I have 2 months worth of blogs stashed somewhere.</p>
<h2><strong>Yups,<a title="belle's sql musings" href="http://www.sqlmusings.com"> http://www.sqlmusings.com</a>. </strong></h2>
<p>Promise, it will be a treat <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/428/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=428&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2009/03/08/ive-moved-httpwwwsqlmusingscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>This Is Why I Teach</title>
		<link>http://sqlmusings.wordpress.com/2008/12/03/this-is-why-i-teach/</link>
		<comments>http://sqlmusings.wordpress.com/2008/12/03/this-is-why-i-teach/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 09:09:21 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[musings]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/?p=412</guid>
		<description><![CDATA[I have been teaching IT courses since 2002; I started as a TA for relational databases and Delphi. Right now I teach part time courses in web development/design, and database development and administration. Wow, it’s already been a while and yet I can still remember my first teaching gig as if it were just yesterday. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=412&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been teaching IT courses since 2002; I started as a TA for relational databases and Delphi. Right now I teach part time courses in web development/design, and database development and administration. <em>Wow, it’s already been a while and yet I can still remember my first teaching gig as if it were just yesterday.</em></p>
<p>Some people ask me why I teach. This is why:</p>
<p><a href="http://sqlmusings.files.wordpress.com/2008/12/ty.jpg"><img title="ty" style="display:inline;border-width:0;" height="248" alt="ty" src="http://sqlmusings.files.wordpress.com/2008/12/ty-thumb.jpg?w=188&#038;h=248" width="188" border="0" /></a>&#160;&#160; <a href="http://sqlmusings.files.wordpress.com/2008/12/ty2.jpg"><img title="ty2" style="display:inline;border-width:0;" height="248" alt="ty2" src="http://sqlmusings.files.wordpress.com/2008/12/ty2-thumb.jpg?w=220&#038;h=248" width="220" border="0" /></a>&#160;<a href="http://sqlmusings.files.wordpress.com/2008/12/ty3.jpg"><img title="ty3" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="248" alt="ty3" src="http://sqlmusings.files.wordpress.com/2008/12/ty3-thumb.jpg?w=248&#038;h=248" width="248" border="0" /></a> </p>
<p>&#160;</p>
<p>I take pains when developing and delivering my courses. I treat teaching very seriously. When students take my class, I want them to really learn something from it. I want them to get their money’s worth (or more!). I want them to walk away with a new skill, or new knowledge, or new discovery, after each class. When they ask me questions I don’t know the answer to, I try to look for the answer – sometimes even spend sleepless nights trying out a few test cases – and present the answer in the next class. </p>
<p>&#160;</p>
<p>Why?    <br />Because I love doing this.</p>
<p>And because I want to make a difference. However small or trivial it may be.</p>
<p>&#160;</p>
<p>My teaching style does not work for all of my students. I do not have all the answers to student questions, and no – not all the demos are flawless in front of the students. </p>
<p>But if I can help someone understand a concept, or look for a solution, or just be someone to bounce ideas with, then it’s all worth it. Or just encourage them to keep on going and not get discouraged …</p>
<p>And sometimes, some students take the time to let me know they appreciate this. And I can’t tell them <font color="#800000"><strong>how much gestures like this mean to instructors like me</strong>.</font></p>
<br />Posted in musings, Teaching, Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/412/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=412&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/12/03/this-is-why-i-teach/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>

		<media:content url="http://sqlmusings.files.wordpress.com/2008/12/ty-thumb.jpg" medium="image">
			<media:title type="html">ty</media:title>
		</media:content>

		<media:content url="http://sqlmusings.files.wordpress.com/2008/12/ty2-thumb.jpg" medium="image">
			<media:title type="html">ty2</media:title>
		</media:content>

		<media:content url="http://sqlmusings.files.wordpress.com/2008/12/ty3-thumb.jpg" medium="image">
			<media:title type="html">ty3</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Scalability etc &#8211; Free Ebooks</title>
		<link>http://sqlmusings.wordpress.com/2008/11/07/sql-server-scalability-etc-free-ebooks/</link>
		<comments>http://sqlmusings.wordpress.com/2008/11/07/sql-server-scalability-etc-free-ebooks/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 08:40:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Ebooks]]></category>
		<category><![CDATA[Resources/References]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/11/07/sql-server-scalability-etc-free-ebooks/</guid>
		<description><![CDATA[RealTimePublishers has a whole bunch of free ebooks: Database The Definitive Guide to Scaling Out SQL Server 2005 The Definitive Guide to Scaling Out SQL Server 2000 The Essentials Series: Optimizing Database Connection Performance The Shortcut Guide to SQL Server Infrastructure Optimization &#160; Few other ones that might be of interest: The Administrator Shortcut Guide [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=407&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://nexus.realtimepublishers.com/">RealTimePublishers</a> has a whole bunch of free ebooks:</p>
<p><strong>Database</strong></p>
<p><a href="http://nexus.realtimepublishers.com/DGSOSS2K5.htm">The Definitive Guide to Scaling Out SQL Server 2005</a>    <br /><a href="http://nexus.realtimepublishers.com/DGSOSS.htm">The Definitive Guide to Scaling Out SQL Server 2000</a>     <br /><a href="http://nexus.realtimepublishers.com/ESODCP.htm">The Essentials Series: Optimizing Database Connection Performance</a>    <br /><a href="http://nexus.realtimepublishers.com/ESODCP.htm">The Shortcut Guide to SQL Server Infrastructure Optimization</a></p>
<p>&#160;</p>
<p><strong>Few other ones that might be of interest:</strong></p>
<p><a href="http://nexus.realtimepublishers.com/asgvbsw.htm">The Administrator Shortcut Guide to VB Scripting for Windows</a>     <br /><a href="http://nexus.realtimepublishers.com/DGBWS2K8I.htm">The Definitive Guide to Building a Windows Server 2008 Infrastructure</a>     <br /><a href="http://nexus.realtimepublishers.com/DGWS2K3TSUE.htm">The Definitive Guide to Windows Server 2003 Terminal Services Updated Edition</a>    <br /><a href="http://nexus.realtimepublishers.com/SGSRVS.htm">The Shortcut Guide to Selecting the Right Virtualization Solution</a>    <br /><a href="http://nexus.realtimepublishers.com/SGSRVS.htm">The Shortcut Guide to Virtualization and Service Automation</a></p>
<p>&#160;</p>
<p><strong>Enjoy!</strong></p>
<br />Posted in Ebooks, Resources/References  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/407/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=407&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/11/07/sql-server-scalability-etc-free-ebooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Connection to target machine could not be made in a timely fashion</title>
		<link>http://sqlmusings.wordpress.com/2008/11/06/connection-to-target-machine-could-not-be-made-in-a-timely-fashion/</link>
		<comments>http://sqlmusings.wordpress.com/2008/11/06/connection-to-target-machine-could-not-be-made-in-a-timely-fashion/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 08:28:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Issues/Troubleshooting]]></category>
		<category><![CDATA[cluster]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/11/06/connection-to-target-machine-could-not-be-made-in-a-timely-fashion/</guid>
		<description><![CDATA[Problem Actually the error is (note spelling mistake on fashion): &#34;Connection to target machine could not be made in a timely fasion&#34; Scenario One of our DBAs was testing the SQL cluster failover. After he failed over from Node 1 to Node 2, he can no longer bring up SQL Server Configuration Manager (SSCM). Whenever [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=406&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#800000"> Problem</font></strong></p>
<p>Actually the error is (note spelling mistake on fashion):</p>
<blockquote><p>&quot;Connection to target machine could not be made in a timely fasion&quot;</p>
</blockquote>
<p><strong><font color="#800000">Scenario</font></strong></p>
<p>One of our DBAs was testing the SQL cluster failover. After he failed over from Node 1 to Node 2, he can no longer bring up SQL Server Configuration Manager (SSCM). Whenever he tried, he will wait for about 30-40 seconds before he gets an error message : Connection to target machine could not be made in a timely fasion</p>
<p><font color="#800000"><strong>Resolution</strong></font></p>
<p>This could have been caused by a whole host of things. </p>
<p>In our case, all we had to do was to restart WMI service:</p>
<ol>
<li>Start &gt; Run &gt; type services.msc and press Enter</li>
<li>Scroll down to Windows Management Instrumentation, right click, restart</li>
</ol>
<br />Posted in Issues/Troubleshooting Tagged: cluster <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=406&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/11/06/connection-to-target-machine-could-not-be-made-in-a-timely-fashion/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>View or function &#8216;sys.dm_exec_sessions&#8217; has more column names &#8230;</title>
		<link>http://sqlmusings.wordpress.com/2008/11/05/view-or-function-sysdm_exec_sessions-has-more-column-names/</link>
		<comments>http://sqlmusings.wordpress.com/2008/11/05/view-or-function-sysdm_exec_sessions-has-more-column-names/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 08:16:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Issues/Troubleshooting]]></category>
		<category><![CDATA[cluster]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/11/05/view-or-function-sysdm_exec_sessions-has-more-column-names/</guid>
		<description><![CDATA[Problem Agent message code 4502. View or function &#8216;sys.dm_exec_sessions&#8217; has more column names specified than columns defined. Scenario Our replication on our clustered database just started to fail. We were getting the following error: Agent message code 4502. View or function &#8216;sys.dm_exec_sessions&#8217; has more column names specified than columns defined. Ok, this is a weird [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=405&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#800000">Problem</font></strong></p>
<p>Agent message code 4502. View or function &#8216;sys.dm_exec_sessions&#8217; has more column names specified than columns defined.</p>
<p><strong><font color="#800000">Scenario</font></strong></p>
<p>Our replication on our clustered database just started to fail. We were getting the following error:</p>
<blockquote><p>Agent message code 4502. View or function &#8216;sys.dm_exec_sessions&#8217; has more column names specified than columns defined.</p>
</blockquote>
<p>Ok, this is a weird message. How can sys.dm_exec_sessions have more columns that specified?</p>
<p>We checked the definition:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">EXEC</span> sp_helptext <span style="color:#006080;">'sys.dm_exec_sessions'</span></pre>
</p></div>
</div>
<p>And this is what we got:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">CREATE</span> <span style="color:#0000ff;">VIEW</span> sys.dm_exec_sessions <span style="color:#0000ff;">AS</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"> <span style="color:#0000ff;">SELECT</span> *</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">OpenRowset</span>(<span style="color:#0000ff;">TABLE</span> SYSSESSIONS)</pre>
</p></div>
</div>
<p>
  <br />Ok, we can see how this can be a problem &#8211; because of the star (*). Any column change can spell disaster. However, we weren&#8217;t very sure why this would cause any problems, because this is not any regular user view. It&#8217;s a built in SQL Server DMV.</p>
<p>So we checked out a few things:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">SELECT</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"> SERVERPROPERTY(<span style="color:#006080;">'ResourceVersion'</span>),</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"> SERVERPROPERTY(<span style="color:#006080;">'ProductVersion'</span>),</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"> SERVERPROPERTY(<span style="color:#006080;">'ProductLevel'</span>)&#160;&#160;&#160; <span style="color:#008000;">-- Service Pack</span></pre>
</p></div>
</div>
<p>It turns out the installed Service Packs are not the same in all the nodes. </p>
<p><strong><font color="#800000">Resolution</font></strong></p>
<p>Make sure all nodes in the cluster have the same service pack. Sometimes it’s easy to miss because you have to failover to install the SP.</p>
<br />Posted in Issues/Troubleshooting Tagged: cluster <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=405&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/11/05/view-or-function-sysdm_exec_sessions-has-more-column-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Ooohh! Manga Guide to Databases!</title>
		<link>http://sqlmusings.wordpress.com/2008/11/02/ooohh-manga-guide-to-databases/</link>
		<comments>http://sqlmusings.wordpress.com/2008/11/02/ooohh-manga-guide-to-databases/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 02:00:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[musings]]></category>
		<category><![CDATA[Japanese Addiction]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/11/02/ooohh-manga-guide-to-databases/</guid>
		<description><![CDATA[I’m an anime/manga/JPop/JDorama junkie. Yup, that’s my other life besides databases. There was a time when I can talk some straight Japanese sentences – because I’ve watched/listened to Japanese stuff so much and so often. JPop I play Utada Hikaru, Ayumi Hamasaki, Do As Infinity (Tomiko Van is lead singer) and Maaya Sakamoto quite regularly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=402&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’m an anime/manga/JPop/JDorama junkie. Yup, that’s my other life besides databases. There was a time when I can talk some straight Japanese sentences – because I’ve watched/listened to Japanese stuff so much and so often.</p>
<p><strong><font color="#800000">JPop</font></strong></p>
<p>I play Utada Hikaru, Ayumi Hamasaki, Do As Infinity (Tomiko Van is lead singer) and Maaya Sakamoto quite regularly while I drive. I have most of their CDs. I even used to wait for weeks for Amazon to deliver my JPop CDs because they’re usually not in stock. I’ve also listened to BoA, Hitomi, Amuro Namie, Otsuka Ai, Gackt, TOKIO, Orange Range, Arashi …</p>
<p><font color="#800000"><strong>JDorama</strong></font></p>
<p>I watched a lot of the TOP 50 JDoramas listed in <a href="http://jdorama.com/topdramas.htm">JDorama.com</a>. Love Mukodono!, Hana Yori Dango, Hanazakari no Kimitachi e, Love Generation, GTO. Also watched Majo no Jouken (First Love) and Ichi Ritoru no Namida&#160; (1 Liter of Tears) and cried buckets (yeah, I’m a weepy). </p>
<p><strong><font color="#800000">Anime/Manga</font></strong></p>
<p>Anime was what started me with this whole Japanese fascination. The first ever anime that I watched was <a href="http://en.wikipedia.org/wiki/Rurouni_Kenshin">Rurouni Kenshin</a> (marketed as Samurai X in North America) – all the episodes plus all OVAs &#8211; and absolutely loved it. My next set of anime/manga marathons Fruits Basket, Full Metal Panic, Trigun, Cowboy Bebop, Escaflowne, Bleach, Inuyasha (yes, I watched all 167 eps). Also&#160; love <a href="http://en.wikipedia.org/wiki/Hayao_Miyazaki">Hayao Miyazaki’s</a> works &#8211; Nausicaä of the Valley of the Wind, Castle in the Sky, Spirited Away, Pricess Mononoke, Howl’s Moving Castle.</p>
<p><font color="#800000"><strong>And the point is?</strong></font></p>
<p><a href="http://www.brentozar.com/">BrentO</a> mentioned on Twitter that there’s a <a href="http://www.amazon.com/Manga-Guide-Databases-Mana-Takahashi/dp/1593271905/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1225675694&amp;sr=8-1"><strong><font size="4">Manga Guide to Databases</font></strong></a> on Amazon! Isn’t that uber coolness! (For me anyway). </p>
<p>Here’s an excerpt (from Amazon):</p>
<blockquote><p>Princess Ruruna is stressed out. With the king and queen away, she has to manage the Kingdom of Kod&#8217;s humongous fruit-selling empire. Overseas departments, scads of inventory, conflicting prices, and so many customers! It&#8217;s all such a confusing mess. <font color="#800000">But a mysterious book and a helpful fairy promise to solve her organizational problems—<strong>with the practical magic of databases</strong></font>. </p>
</blockquote>
<p>Haha doesn’t that problem sound all too familiar.</p>
<p>The cover is also super cute! Thanks Brent! I am pre-ordering it with <a href="http://www.amazon.com/Tales-Beedle-Bard-Standard/dp/0545128285/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1225677350&amp;sr=1-1">JK Rowling’s Tales of Beedle the Bard</a>. So excited.</p>
<p>PS – And if you are looking for good Japanese Tea, you may want to try out <a href="http://hibiki-an.com/">Hibiki-an</a>. Great tea! And they deliver it so fast too.</p>
<br />Posted in musings Tagged: Japanese Addiction <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/402/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=402&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/11/02/ooohh-manga-guide-to-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Soaking in SQLServerPedia</title>
		<link>http://sqlmusings.wordpress.com/2008/10/31/soaking-in-sqlserverpedia/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/31/soaking-in-sqlserverpedia/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 05:18:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[DBA Toolbox / T-SQL Scripts]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[Resources/References]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[SQLServerPedia]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/31/soaking-in-sqlserverpedia/</guid>
		<description><![CDATA[One of the bloggers I follow is Brent Ozar. I tell you I’m a fan. I like the way he writes his stuff. Anyway, he blogged about The Problem With SQL Server Training Today, and The Answer to SQL Server Training Problems a week or so ago. And this is the answer – SQLServerPedia&#160; &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=400&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the bloggers I follow is <a href="http://www.brentozar.com/">Brent Ozar</a>. I tell you I’m a fan. I like the way he writes his stuff. </p>
<p>Anyway, he blogged about <a href="http://www.brentozar.com/archive/2008/10/the-problem-with-sql-server-training-today/">The Problem With SQL Server Training Today</a>, and <a href="http://www.brentozar.com/archive/2008/10/the-solution-to-sql-server-training-problems/">The Answer to SQL Server Training Problems</a> a week or so ago. And this is the answer – <a href="http://sqlserverpedia.com/blog/">SQLServerPedia&#160; &#8211; SQL Server Knowledge and Advice Straight from the Experts</a>.</p>
<p>So in between giving out candies to cute little Indiana Joneses, pirates of the Caribbean, vampires and dead cheerleaders, I’ve been soaking in SQLServerPedia (geeky ‘no?). So far, so good. I’ll be a frequent flyer.</p>
<p>&#160;</p>
<p>PS – and if you’re a DBA, you’ll find great laughs in this post <a title="http://www.brentozar.com/archive/2008/10/somebody-created-a-halloween-monster-sqlputdowns/" href="http://www.brentozar.com/archive/2008/10/somebody-created-a-halloween-monster-sqlputdowns/">: Somebody Created a Halloween Monster #SQLputdowns</a></p>
<br />Posted in DBA Toolbox / T-SQL Scripts, musings, Resources/References, Tutorials Tagged: SQLServerPedia <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/400/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=400&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/31/soaking-in-sqlserverpedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Drop and Re-Add Server Registration When Renaming Computer</title>
		<link>http://sqlmusings.wordpress.com/2008/10/31/drop-and-re-add-server-registration-when-renaming-computer/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/31/drop-and-re-add-server-registration-when-renaming-computer/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 04:38:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[DBA Toolbox / T-SQL Scripts]]></category>
		<category><![CDATA[Issues/Troubleshooting]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/31/drop-and-re-add-server-registration-when-renaming-computer/</guid>
		<description><![CDATA[Problem: SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, &#8216;SQLVM\SQL02&#8242;. (Replication.Utilities) Scenario: 1. We configured database mirroring on 2 SQL Server instances. 2. We changed the computer name [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=398&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#800000">Problem:</font></strong> </p>
<p>SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, &#8216;SQLVM\SQL02&#8242;. (Replication.Utilities)</p>
<p><font color="#800000"><strong>Scenario:</strong></font></p>
<p>1. We configured database mirroring on 2 SQL Server instances. </p>
<p>2. We changed the computer name from SQLVM to SQL2K5.</p>
<p>3. We tried launching the Database Mirroring monitor, but we got the following error:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">SQL Server replication requires the actual server name to make a connection </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">to the server. Connections through a server alias, IP address, or any other </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">alternate name are not supported. Specify the actual server name, <span style="color:#006080;">'SQLVM\SQL02'</span>. </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">(Replication.Utilities)</pre>
</p></div>
</div>
<p>If you just look at the error, it sounds a bit misleading because we don’t have replication configured in either of the servers.</p>
<p><strong><font color="#800000">Resolution:</font></strong></p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#008000;">-- 1. drop old server/instance name</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">EXEC</span> sp_dropserver [sqlvm\sql01] </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">GO</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">&#160;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#008000;">-- 2. add newserver/instance name</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#008000;">-- local meaning we're adding the local machine</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">EXEC</span> sp_addserver [mysql2k5\sql01], <span style="color:#0000ff;">local</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">GO</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">&#160;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#008000;">-- 3. Restart SQL Server service</span></pre>
</p></div>
</div>
<br />Posted in DBA Toolbox / T-SQL Scripts, Issues/Troubleshooting Tagged: Replication <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/398/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=398&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/31/drop-and-re-add-server-registration-when-renaming-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server-Related Cheat Sheets That Can Save You Time</title>
		<link>http://sqlmusings.wordpress.com/2008/10/17/sql-server-related-cheat-sheets-that-can-save-you-time/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/17/sql-server-related-cheat-sheets-that-can-save-you-time/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 06:22:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[DBA Toolbox / T-SQL Scripts]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/17/sql-server-related-cheat-sheets-that-can-save-you-time/</guid>
		<description><![CDATA[I previously posted about a SQL Server CheatSheet from DotNet4All that I thought was useful and comprehensive. If you already know what you need to do, but just forgot the syntax because you haven’t done it in eons, then&#160; a well organized, concise, complete cheat sheet can save the day. &#160; Here are a few [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=390&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I previously posted about a <a href="http://sqlmusings.wordpress.com/2008/10/08/sql-server-2005-cheat-sheet/">SQL Server CheatSheet from DotNet4All</a> that I thought was useful and comprehensive. If you already know what you need to do, but just forgot the syntax because you haven’t done it in eons, then&#160; a well organized, concise, complete cheat sheet can save the day.     </p>
<p>&#160;</p>
<p>Here are a few other ones: </p>
<p><strong><font color="#800000">General SQL Server</font></strong>     <br /><a href="http://www.dotnet4all.com/snippets/factsheet%20SQL%20Server.pdf">DotNet4All</a></p>
<p><a href="http://www.pinaldave.com/sql-download/SQLServerCheatSheet.pdf">SQLAuthority</a>     <br /><a href="http://www.scribd.com/doc/399147/TSQL-Cheat-Sheet">Scribd T-SQL</a></p>
<p>&#160;</p>
<p><strong><font color="#800000">SQL Server Shortcuts        <br /></font></strong><a href="http://sql-articles.com/index.php?page=articles/shortcut_keys.htm">SQLArticles</a> (really good, exhaustive list!)     <br /><a href="http://www.pinaldave.com/download/SQL_Server_Management_Studio_Keyboard_Shortcuts.pdf">SQLAuthority SSMS Shortcuts</a></p>
<p>&#160;</p>
<p><strong><font color="#800000">Connection Strings        <br /></font></strong><a href="http://www.connectionstrings.com/">ConnectionStrings.com</a></p>
<p>&#160;</p>
<p><strong><font color="#800000">Regex (especially when you&#8217;re working with SQLCLR/Regex)        <br /></font></strong><a href="http://regexlib.com/CheatSheet.aspx">.NET Regex Cheat Sheet</a>     <br /><a href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet">AddedBytes</a>     <br />(AddedBytes used to be known as ILoveJackDaniels, but that name has changed. Dave has a *lot* of useful cheat sheets in his site.) </p>
<p>&#160;</p>
<p><font color="#800000"><strong>SQL Injection        <br /></strong></font><a href="http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/#SyntaxBasicAttacks">Ferruh Mavituna</a>     <br /><a href="http://ha.ckers.org/sqlinjection/">ha.ckers</a></p>
<p>&#160;</p>
<p><strong><font color="#800000">PowerShell        <br /></font></strong><a href="http://blogs.msdn.com/powershell/attachment/1525634.ashx">MSDN Blogs (PDF)</a>     <br /><a href="http://blogs.msdn.com/powershell/attachment/1521595.ashx">MSDN Blogs (MS Word)</a></p>
<p>&#160;</p>
<p><strong><font color="#800000">SQL Server 2008        <br /></font></strong><a href="http://blog.sqlauthority.com/2008/10/02/sql-server-2008-cheat-sheet-one-page-pdf-download/">SQLAuthority</a></p>
<p>&#160;</p>
<p><font color="#800000"><strong>SQL Server DBA Interview Questions        <br /></strong></font><a href="http://blog.sqlauthority.com/2008/09/20/sql-server-2008-interview-questions-and-answers-complete-list-download/">SQLAuthority Interview Questions &#8211; Complete List </a></p>
<br />Posted in DBA Toolbox / T-SQL Scripts, Powershell Tagged: Cheat Sheet, SQL Injection <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/390/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/390/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/390/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=390&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/17/sql-server-related-cheat-sheets-that-can-save-you-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>What to do if you accidentally lock yourself out of SQL Server (SINGLE_USER mode)?</title>
		<link>http://sqlmusings.wordpress.com/2008/10/17/what-to-do-if-you-accidentally-lock-yourself-out-of-sql-server-single_user-mode/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/17/what-to-do-if-you-accidentally-lock-yourself-out-of-sql-server-single_user-mode/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 04:52:35 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[DBA Toolbox / T-SQL Scripts]]></category>
		<category><![CDATA[Issues/Troubleshooting]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/17/what-to-do-if-you-accidentally-lock-yourself-out-of-sql-server-single_user-mode/</guid>
		<description><![CDATA[Problem: Msg 5064, Level 16, State 1, Line 1 Changes to the state or options of database &#60;your db name&#62; cannot be made at this time. The database is in single-user mode, and a user is currently connected to it. Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.&#34; Scenario: Sometimes you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=387&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#800000">Problem:</font></strong></p>
<p>Msg 5064, Level 16, State 1, Line 1   <br />Changes to the state or options of database &lt;your db name&gt; cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.    <br />Msg 5069, Level 16, State 1, Line 1    <br />ALTER DATABASE statement failed.&quot;</p>
<p><strong><font color="#800000">Scenario:</font></strong></p>
<p>Sometimes you need to have &quot;exclusive&quot; access to the database, let&#8217;s say, </p>
<ul>
<li>when you want to force a restore, or </li>
<li>when you want to alter the database and an exclusive lock is required</li>
</ul>
<p>To get this exclusive access, you may need to set the database to SINGLE_USER mode:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">USE</span> [master]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">GO</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">&#160;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">ALTER</span> <span style="color:#0000ff;">DATABASE</span> [DBName]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">SET</span> SINGLE_USER <span style="color:#0000ff;">WITH</span> <span style="color:#0000ff;">ROLLBACK</span> <span style="color:#0000ff;">IMMEDIATE</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">GO</pre>
</p></div>
</div>
<p>However, what if you accidentally lock yourself out of the database?<br />
  <br />What if for some reason there is some other connection or user that is using the database, you will most probably get this error :</p>
<blockquote>
<p><font color="#ff0000">&quot;Msg 5064, Level 16, State 1, Line 1<br />
      <br />Changes to the state or options of database  &lt;your db name&gt; cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.</p>
<p>Msg 5069, Level 16, State 1, Line 1</p>
<p>ALTER DATABASE statement failed.&quot;</p>
<p></font></p>
</blockquote>
<p>How do you get yourself back in?</p>
<p><strong><font color="#800000">Resolution:</font></strong></p>
<p>1. Determine which connection is actually locking you out</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#008000;">-- look for the connection that uses your db and note the spid</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">EXEC</span> sp_who</pre>
</p></div>
</div>
<p>&#160;</p>
<p>2. Kill the connection</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">KILL</span> &lt;spid&gt;</pre>
</p></div>
</div>
<p>
  <br />3. Change the database back to MULTI_USER</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">ALTER</span> <span style="color:#0000ff;">DATABASE</span> [DBName]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">SET</span> MULTI_USER;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">GO</pre>
</p></div>
</div>
<p>That should do it. <img alt="Happy" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" /></p>
<br />Posted in DBA Toolbox / T-SQL Scripts, Issues/Troubleshooting  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/387/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=387&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/17/what-to-do-if-you-accidentally-lock-yourself-out-of-sql-server-single_user-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>

		<media:content url="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" medium="image">
			<media:title type="html">Happy</media:title>
		</media:content>
	</item>
		<item>
		<title>Is a Low NULL Diet healthy?</title>
		<link>http://sqlmusings.wordpress.com/2008/10/16/is-a-low-null-diet-healthy/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/16/is-a-low-null-diet-healthy/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 04:55:00 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[musings]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/16/is-a-low-null-diet-healthy/</guid>
		<description><![CDATA[It’s funny. I wonder which database they are using http://thedailywtf.com/Articles/A-Low(null)-Diet.aspx Posted in musings<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=389&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It’s funny. I wonder which database they are using <img alt="Light bulb" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/lightbulb.gif" /></p>
<p><a title="http://thedailywtf.com/Articles/A-Low(null)-Diet.aspx" href="http://thedailywtf.com/Articles/A-Low(null)-Diet.aspx">http://thedailywtf.com/Articles/A-Low(null)-Diet.aspx</a></p>
<br />Posted in musings  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=389&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/16/is-a-low-null-diet-healthy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>

		<media:content url="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/lightbulb.gif" medium="image">
			<media:title type="html">Light bulb</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Connect to an Instance Name Using SMO</title>
		<link>http://sqlmusings.wordpress.com/2008/10/13/how-to-connect-to-an-instance-name-using-smo/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/13/how-to-connect-to-an-instance-name-using-smo/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 21:13:27 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[SMO]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/?p=352</guid>
		<description><![CDATA[1. Create your Visual Studio Project 2. Add the following references in your project Microsoft.SqlServer.ConnectionInfo Microsoft.SqlServer.Smo Microsoft.SqlServer.SmoEnum Microsoft.SqlServer.SqlEnum 3. Include the following using statement: using Microsoft.SqlServer.Management.Smo; 4. Add your server object. Normally, you would use the following format in your Server object: String serverName = "JUBILEE"; Server srv = new Server(serverName); Database db = srv.Databases["AdventureWorks"]; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=352&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Create your Visual Studio Project</p>
<p>2. Add the following references in your project</p>
<p><a href="http://sqlmusings.files.wordpress.com/2008/10/smoreferences.jpg"><img class="alignnone size-full wp-image-353" style="border:1px solid #d4d0c8;padding:5px;" title="SMO References in Visual Studio Project" src="http://sqlmusings.files.wordpress.com/2008/10/smoreferences.jpg?w=321&#038;h=253" alt="" width="321" height="253" /></a></p>
<ul>
<li>Microsoft.SqlServer.ConnectionInfo</li>
<li>Microsoft.SqlServer.Smo</li>
<li>Microsoft.SqlServer.SmoEnum</li>
<li>Microsoft.SqlServer.SqlEnum</li>
</ul>
<p>3. Include the following using statement:</p>
<div>
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"><span style="color:#0000ff;">using</span> Microsoft.SqlServer.Management.Smo;</pre>
</div>
</div>
<p>4. Add your server object. Normally, you would use the following format in your Server object:</p>
<div>
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">String serverName  = <span style="color:#006080;">"JUBILEE"</span>;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">Server srv         = <span style="color:#0000ff;">new</span> Server(serverName);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">Database db        = srv.Databases[<span style="color:#006080;">"AdventureWorks"</span>];</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">txtServerInfo.Text = srv.Information.VersionString +</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">                     System.Environment.NewLine;</pre>
</div>
</div>
<p>However, if you have an instance name, you have to specify the SERVER\INSTANCE name in your Server object. In C# code:</p>
<div>
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"><span style="color:#006080;"></p>
<h4><strong>String serverName = <span style="color:#006080;">&#8220;JUBILEE&#8221;</span> + <span style="color:#006080;">@&#8221;\&#8221; + &#8220;</span>SQL01</strong><span style="color:#006080;"><strong>&#8220;;</strong></span></h4>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">Server srv         = new Server(serverName);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">Database db        = srv.Databases["AdventureWorks"];</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">txtServerInfo.Text = srv.Information.VersionString +</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;">                     System.Environment.NewLine;</pre>
<p></span></div>
</div>
<br />Posted in SMO Tagged: SMO <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/352/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=352&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/13/how-to-connect-to-an-instance-name-using-smo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>

		<media:content url="http://sqlmusings.files.wordpress.com/2008/10/smoreferences.jpg" medium="image">
			<media:title type="html">SMO References in Visual Studio Project</media:title>
		</media:content>
	</item>
		<item>
		<title>Valid SQLXML XSD Data Types, and Sample SQL Server XML Schemas</title>
		<link>http://sqlmusings.wordpress.com/2008/10/13/valid-sqlxml-xsd-data-types-and-sample-sql-server-xml-schemas/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/13/valid-sqlxml-xsd-data-types-and-sample-sql-server-xml-schemas/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 10:46:48 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[SQLXML]]></category>
		<category><![CDATA[T-SQL Tips and Tricks]]></category>
		<category><![CDATA[XSD]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/13/valid-sqlxml-xsd-data-types-and-sample-sql-server-xml-schemas/</guid>
		<description><![CDATA[Here is a partial list of valid XSD data types for SQL Server 2005: xsd:int or xsd:integer xsd:decimal xsd:date xsd:dateTime xsd:string xsd:base64Binary &#160; Note that in SQL Server 2005, the timezone needs to be included in the date or dateTime element or attribute value, for example: &#60;Authors&#62; &#60;Author AuthorID=&#34;1&#34; FirstName=&#34;John&#34; LastName=&#34;Doe&#34; IsIndependent=&#34;true&#34; DateJoined=&#34;1992-05-01Z&#34; DateTimeJoined=&#34;1992-05-01T00:00:00Z&#34;/&#62; &#60;/Authors&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=339&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a partial list of valid XSD data types for SQL Server 2005:</p>
<table cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;" valign="top" width="400">xsd:int or xsd:integer</td>
</tr>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;" valign="top" width="400">xsd:decimal</td>
</tr>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;" valign="top" width="400">xsd:date</td>
</tr>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;" valign="top" width="400">xsd:dateTime</td>
</tr>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;" valign="top" width="400">xsd:string</td>
</tr>
<tr>
<td style="border-right:#d4d0c8 1px solid;border-top:#d4d0c8 1px solid;border-left:#d4d0c8 1px solid;border-bottom:#d4d0c8 1px solid;" valign="top" width="400">xsd:base64Binary</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>Note that in SQL Server 2005, the timezone needs to be included in the date or dateTime element or attribute value, for example:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Authors</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Author</span> <span style="color:#ff0000;">AuthorID</span><span style="color:#0000ff;">=&quot;1&quot;</span> <span style="color:#ff0000;">FirstName</span><span style="color:#0000ff;">=&quot;John&quot;</span> <span style="color:#ff0000;">LastName</span><span style="color:#0000ff;">=&quot;Doe&quot;</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">            <span style="color:#ff0000;">IsIndependent</span><span style="color:#0000ff;">=&quot;true&quot;</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            <span style="color:#ff0000;">DateJoined</span><span style="color:#0000ff;">=&quot;1992-05-01Z&quot;</span> <span style="color:#ff0000;">DateTimeJoined</span><span style="color:#0000ff;">=&quot;1992-05-01T00:00:00Z&quot;</span><span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Authors</span><span style="color:#0000ff;">&gt;</span></pre>
</p></div>
</div>
<p>Note the existence of the letter <strong><font color="#ff0000">Z</font></strong> at the end of the date and datetime attributes.</p>
<p>&#160;</p>
<p>Microsoft also provided a list of schemas in <a title="http://schemas.microsoft.com/sqlserver/" href="http://schemas.microsoft.com/sqlserver/. It">http://schemas.microsoft.com/sqlserver/</a>. It includes the following AdventureWorks sample schemas:</p>
<ul>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo">AdventureWorks Customer Contact Information Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord">AdventureWorks Customer Contact Record Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes">AdventureWorks Customer Contact Type Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey">AdventureWorks Consumer Demographics Survey Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription">AdventureWorks Product Catalog Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions">AdventureWorks Manufacturing Instructions Document Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain">AdventureWorks Product Warranty and Maintenance Information Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume">AdventureWorks Standard Resume Schema</a> </li>
<li><a href="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey">AdventureWorks Retail Stores Demographics Survey Schema</a> </li>
</ul>
<br />Posted in SQLXML, T-SQL Tips and Tricks Tagged: SQLXML, XSD <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/339/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=339&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/13/valid-sqlxml-xsd-data-types-and-sample-sql-server-xml-schemas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Clustering SQL Server 2005 Videos &#8230; and some hacking</title>
		<link>http://sqlmusings.wordpress.com/2008/10/11/clustering-sql-server-2005-videos-and-some-hacking/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/11/clustering-sql-server-2005-videos-and-some-hacking/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 06:41:04 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Resources/References]]></category>
		<category><![CDATA[Clustering]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[Video Training]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/11/clustering-sql-server-2005-videos-and-some-hacking/</guid>
		<description><![CDATA[Brian Knight has posted a lot of good videos on JumpStartTV, including the following clustering videos: Windows and SQL Server 2005 Clustering Architecture  (16:14) http://www.jumpstarttv.com/windows-and-sql-server-2005-clustering-architecture_31.aspx Clustering Windows 2003 R2  (13:26) http://www.jumpstarttv.com/clustering-windows-2003-r2_32.aspx Clustering SQL Server 2005  (16:21) http://www.jumpstarttv.com/clustering-sql-server-2005_33.aspx Plus one video on how to hack (read: SQL Injection), and prevent hacking, SQL Server: Hacking SQL Server   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=328&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pragmaticworks.com/community/blogs/brianknight/default.aspx">Brian Knight</a> has posted a lot of good videos on <a href="http://www.jumpstarttv.com">JumpStartTV</a>, including the following clustering videos:</p>
<ul>
<li>Windows and SQL Server 2005 Clustering Architecture  (16:14)<br />
<a href="http://www.jumpstarttv.com/windows-and-sql-server-2005-clustering-architecture_31.aspx">http://www.jumpstarttv.com/windows-and-sql-server-2005-clustering-architecture_31.aspx</a></li>
<li>Clustering Windows 2003 R2  (13:26)<br />
<a href="http://www.jumpstarttv.com/clustering-windows-2003-r2_32.aspx">http://www.jumpstarttv.com/clustering-windows-2003-r2_32.aspx</a></li>
<li>Clustering SQL Server 2005  (16:21)<br />
<a href="http://www.jumpstarttv.com/clustering-sql-server-2005_33.aspx">http://www.jumpstarttv.com/clustering-sql-server-2005_33.aspx</a></li>
</ul>
<p>Plus one video on how to hack (read: SQL Injection), and prevent hacking, SQL Server:</p>
<ul>
<li>Hacking SQL Server   (55:59)<br />
<a href="http://www.jumpstarttv.com/hacking-sql-server_76.aspx">http://www.jumpstarttv.com/hacking-sql-server_76.aspx</a></li>
</ul>
<p>These are good videos, some of them almost an hour long like the Hacking video, most in the 5-15 minute duration. What’s also good about the site is  on the sidebar, the “pre-requisite” videos are mentioned.</p>
<p>JumpStartTV also has videos on Administration, High Availability, Performance Tuning, SMO, Data Warehousing and SSIS (Brian Knight made a whole bunch on SSIS), to name a few.</p>
<p>The videos are free, but <a href="http://www.jumpstarttv.com">JumpStartTV</a> requires registration.</p>
<br />Posted in Resources/References Tagged: Clustering, SQL Injection, Video Training <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/328/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=328&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/11/clustering-sql-server-2005-videos-and-some-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
		<item>
		<title>Order of Attribute-Centric Columns in FOR XML PATH matters</title>
		<link>http://sqlmusings.wordpress.com/2008/10/11/order-of-attribute-centric-columns-in-for-xml-path-matters/</link>
		<comments>http://sqlmusings.wordpress.com/2008/10/11/order-of-attribute-centric-columns-in-for-xml-path-matters/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 00:33:24 +0000</pubDate>
		<dc:creator>belle</dc:creator>
				<category><![CDATA[Issues/Troubleshooting]]></category>
		<category><![CDATA[SQLXML]]></category>

		<guid isPermaLink="false">http://sqlmusings.wordpress.com/2008/10/11/order-of-attribute-centric-columns-in-for-xml-path-matters/</guid>
		<description><![CDATA[Error: Attribute-centric column &#8216;@Title&#8217; must not come after a&#160; non-attribute-centric sibling in XML hierarchy in FOR XML PATH. Reason: You are having this issue if you have attribute- and element-centric columns in your FOR XML PATH query that are interleaved, as such: SELECT EmployeeID AS '@EmployeeID', -- attribute FirstName AS 'Details/FirstName', -- nested element LastName [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=326&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Error:</strong></p>
<p><font color="#ff0000">Attribute-centric column &#8216;@Title&#8217; must not come after a&#160; non-attribute-centric sibling in XML hierarchy in FOR XML PATH.</font></p>
<p><strong>Reason:</strong></p>
<p>You are having this issue if you have attribute- and element-centric columns in your FOR XML PATH query that are interleaved, as such:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">SELECT</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    EmployeeID       <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'@EmployeeID'</span>,            <span style="color:#008000;">-- attribute</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    FirstName        <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'Details/FirstName'</span>,      <span style="color:#008000;">-- nested element</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    LastName         <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'Details/LastName'</span>,       <span style="color:#008000;">-- nested element</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    Title            <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'@Title'</span>                  <span style="color:#008000;">-- attribute</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">FROM</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    dbo.Employee</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">FOR</span> XML <span style="color:#0000ff;">PATH</span>(<span style="color:#006080;">'Employee'</span>)</pre>
</p></div>
</div>
<p><strong>Resolution:</strong></p>
<p>Order of attribute-centric columns in your FOR XML PATH query matters … if you have nested elements.</p>
<p>To resolve the error above, you must specify all attributes first, then specify the nested elements</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">SELECT</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    EmployeeID       <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'@EmployeeID'</span>,            <span style="color:#008000;">-- attribute</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    Title            <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'@Title'</span>,                 <span style="color:#008000;">-- attribute</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    FirstName        <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'Details/FirstName'</span>,      <span style="color:#008000;">-- nested element</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    LastName         <span style="color:#0000ff;">AS</span> <span style="color:#006080;">'Details/LastName'</span>        <span style="color:#008000;">-- nested element</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">FROM</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    dbo.Employee</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">FOR</span> XML <span style="color:#0000ff;">PATH</span>(<span style="color:#006080;">'Employee'</span>)</pre>
</p></div>
</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;"></div>
</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">/*</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">Sample <span style="color:#0000ff;">Output</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">&#160;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">&lt;Employee EmployeeID=&quot;1&quot; Title=&quot;Production Technician - WC60&quot;&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">  &lt;Details&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;FirstName&gt;Guy&lt;/FirstName&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">    &lt;LastName&gt;Gilbert&lt;/LastName&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">  &lt;/Details&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;">&lt;/Employee&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">*/</pre>
</p></div>
</div>
<br />Posted in Issues/Troubleshooting, SQLXML Tagged: SQLXML <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlmusings.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlmusings.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlmusings.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqlmusings.wordpress.com&amp;blog=3392387&amp;post=326&amp;subd=sqlmusings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sqlmusings.wordpress.com/2008/10/11/order-of-attribute-centric-columns-in-for-xml-path-matters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add8dcf4f78f46a9184b4cae131a6f4b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">belle</media:title>
		</media:content>
	</item>
	</channel>
</rss>
