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

<channel>
	<title>John Sansom - SQL Server DBA in the UK &#187; SQL Server Tips</title>
	<atom:link href="http://www.johnsansom.com/index.php/category/sql-server-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnsansom.com</link>
	<description>SQL Server DBA Blog, with straightforward advice, quality resources and musings about SQL Server</description>
	<lastBuildDate>Fri, 10 Sep 2010 12:45:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Simplify Your DBCC CHECKDB Output</title>
		<link>http://www.johnsansom.com/index.php/2010/07/simplify-your-dbcc-checkdb-output/</link>
		<comments>http://www.johnsansom.com/index.php/2010/07/simplify-your-dbcc-checkdb-output/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 11:30:57 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[CHECKDB]]></category>
		<category><![CDATA[SQL Server Admins]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=2467</guid>
		<description><![CDATA[If you’re a SQL Server Database Administrator and you don’t know what CHECKDB is then you need to stop whatever it is your are doing right now and read this. Seriously, just go ahead and do it now. It will only take you ten minutes to get to grips with the basics and it could [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">
<div id="attachment_2475" class="wp-caption alignright" style="width: 310px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: right;"><img class="size-medium wp-image-2475" title="Defend Your Data" src="http://www.johnsansom.com/wp-content/uploads/2010/07/castle-300x200.jpg" alt="Defend Your Data" width="300" height="200" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">&quot;Defend Your Data&quot;</p></div>
<p>If you’re a SQL Server Database Administrator and you don’t know what CHECKDB is then you need to stop whatever it is your are doing right now and <a title="CHECKDB" href="http://msdn.microsoft.com/en-us/library/ms176064(SQL.90).aspx">read this</a>. Seriously, just go ahead and do it now. It will only take you ten minutes to get to grips with the basics and it could save not only your job but also the company you work for. CHECKDB is arguably the most valuable tool in the DBA toolkit and you would be a fool to miss it.</p>
<p style="text-align: justify;">Now as I’m sure you already know, when you perform a DBCC CHECKDB operation, by default you will be provided with a considerable amount of informational output, not all of which you may be interested in.</p>
<p style="text-align: justify;">If like me, you like to make life easy for yourself and you are really only interested in output pertaining to any errors that have been found, then you will pleased to hear of the handy argument <em>NO_INFOMSGS</em> available to you (see example below). Using this argument with your CHECKDB operations will suppress “informational only” output, leaving you in a position to more easily identify any errors that may have been reported.</p>
<p style="padding-left: 30px;"><em><span style="color: #000080;">DBCC CHECKDB(‘DatabaseName’) WITH NO_INFOMSGS, ALL_ERRORMSGS</span></em></p>
<p style="text-align: justify;">Note: Technically you do not need to use the ALL_ERRORMSGS argument for errors to be displayed in the more recent versions of SQL Server as this is the default behaviour however, if like a lot of DBA’s you manage multiple versions of SQL Server then it’s good practice to include it in order to be absolutely certain you will get the output your desire across the board.</p>
<p style="text-align: justify;">Life’s complicated enough as it is, so let’s keep things simple when we can.</p>
<h3>Similar Posts on &#8220;keeping things simple&#8221; and &#8220;looking after your data&#8221;</h3>
<ul>
<li><a title="DBA Survival Skills - Think Defensively" href="http://www.johnsansom.com/index.php/2010/04/dba-survival-skills-think-defensively/">DBA Survival Skills – Think Defensively</a></li>
<li><a title="TLC and SQL Server Error Log Management" href="http://www.johnsansom.com/index.php/2010/04/tlc-and-sql-server-error-log-management/">TLC and SQL Server Error Log Management</a></li>
<li><a href="http://www.johnsansom.com/index.php/2009/07/the-database-administrators-primary-responsibility/">SQL Server Essentials – Part 1: The Database Administrator’s Primary Responsibility</a></li>
<li><a href="http://www.johnsansom.com/index.php/2009/07/why-you-should-be-using-the-full-recovery-model/">SQL Server Essentials – Part 2: Why you should be using the FULL Recovery Model</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2010/07/simplify-your-dbcc-checkdb-output/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>With Great Advice Comes Great Responsibility</title>
		<link>http://www.johnsansom.com/index.php/2010/05/with-great-advice-comes-great-responsibility/</link>
		<comments>http://www.johnsansom.com/index.php/2010/05/with-great-advice-comes-great-responsibility/#comments</comments>
		<pubDate>Sun, 02 May 2010 16:06:26 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Professional Development]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=2213</guid>
		<description><![CDATA[I know that you have seen it yourself too. That forum or blog post that contains &#8220;advice&#8221; that is daft, stupid or worst of all just plain wrong. The SQL Server community is an awesome phenomena. Through collaboration and collective contribution across a wide variety of channels, the community empowers it&#8217;s members to become better [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I know that you have seen it yourself too. That forum or blog post that contains &#8220;advice&#8221; that is daft, stupid or worst of all just plain wrong.</p>
<p style="text-align: justify;">The SQL Server community is an awesome phenomena. Through collaboration and collective contribution across a wide variety of channels, the community empowers it&#8217;s members to become better data professionals. It is truly a great place to be and I encourage you all not to miss out on such a rewarding experience and to get involved as much as you can.</p>
<p style="text-align: justify;">Personally I really enjoy sharing my experiences with SQL Server and in doing so I like to think that I understand the importance and implications of the content I share, whether it be a blog post, a comment on Twitter or a reply on a forum.</p>
<p style="text-align: justify;">Every so often I find poor or even worse incorrect advice being spouted around the online community as if it were gospel and so I wanted to take a moment to briefly make this point.</p>
<p><strong><em><span style="color: #800000;">&#8220;The content you are sharing has the potential to be acted upon.&#8221;</span></em></strong></p>
<div><strong><em><span style="color: #800000;"> </span></em></strong></div>
<div><strong><em> </em></strong></div>
<div style="text-align: justify;">This is after all the point of offering guidance and assistance, to help others. So if you are not completely certain of the accuracy of the advice or content that you are providing then please either do not publish it in the first place or at least make clear your uncertainties to the reader. Just keep in mind that with great advice comes great responsibility and together we can raise the quality of information within our community.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2010/05/with-great-advice-comes-great-responsibility/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SQL Snippet: Who owns that SQL Server Job?</title>
		<link>http://www.johnsansom.com/index.php/2010/03/sql-snippet-who-owns-that-sql-server-job/</link>
		<comments>http://www.johnsansom.com/index.php/2010/03/sql-snippet-who-owns-that-sql-server-job/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 12:20:08 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL Server Agent Jobs]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[TSQL]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=1990</guid>
		<description><![CDATA[Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job. From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job.</p>
<p>From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server Agent Job via SQL Server Management Studio, by default their Login will be assigned as the owner of the job. This is often not a desirable choice of owner and so it&#8217;s good idea to do a little house keeping every once in a while and check who the current Job Owners are for your environment.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">USE</span> msdb;<br />
<br />
<span style="color: #993333; font-weight: bold;">SELECT</span><br />
A<span style="color: #66cc66;">.</span>Name <span style="color: #993333; font-weight: bold;">AS</span> JobName<span style="color: #66cc66;">,</span><br />
B<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> JobOwner<br />
<span style="color: #993333; font-weight: bold;">FROM</span> dbo<span style="color: #66cc66;">.</span>sysjobs A<br />
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> master<span style="color: #66cc66;">.</span>sys<span style="color: #66cc66;">.</span>syslogins B <span style="color: #993333; font-weight: bold;">ON</span><br />
A<span style="color: #66cc66;">.</span>owner_sid <span style="color: #66cc66;">=</span> B<span style="color: #66cc66;">.</span>sid;</div></div>
<h3>More Handy SQL Snippets</h3>
<ul>
<li><a title="What SQL Server Agent Jobs were running at that time?" href="http://www.johnsansom.com/index.php/2009/12/sql-agent-jobs-time-query/">What SQL Server Agent Jobs were running at &#8220;that&#8221; time?</a></li>
<li><a title="Most Costly SQL Server Queries" href="http://www.johnsansom.com/index.php/2009/05/how-to-identify-the-most-costly-sql-server-queries-using-dmvs/?preview=true&amp;preview_id=499&amp;preview_nonce=25ddb9893e">How to identify the most costly SQL Server queries using DMV’s</a></li>
<li><a title="Highest SQL Server Waits by Percentage" href="http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/">Highest SQL Server Waits by Percentage</a></li>
<li><a title="Identify All Active SQL Server Sessions" href="http://www.johnsansom.com/index.php/2009/06/dmv-query-to-identify-all-active-sql-server-sessions/">Identify All Active SQL Server Sessions</a></li>
</ul>
<p>I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any questions regarding this snippet, SQL Server Agent Jobs or anything to do with SQL Server then let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2010/03/sql-snippet-who-owns-that-sql-server-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 Junior DBA Interview Tips</title>
		<link>http://www.johnsansom.com/index.php/2010/02/top-10-junior-dba-interview-tips/</link>
		<comments>http://www.johnsansom.com/index.php/2010/02/top-10-junior-dba-interview-tips/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 09:00:18 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Professional Development]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[Interview Tips]]></category>
		<category><![CDATA[Junior DBA]]></category>
		<category><![CDATA[Junior DBA Tips]]></category>
		<category><![CDATA[SQL Server Junior DBA]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=1750</guid>
		<description><![CDATA[The start of a new year is a time for self reflection and along with it perhaps a desire to do something new with your career. Maybe you are considering becoming a Junior Database Administrator (DBA)? Acquiring your very first role as a Junior DBA is no easy feat. Just browse any one of the [...]]]></description>
			<content:encoded><![CDATA[<p>The start of a new year is a time for self reflection and along with it perhaps a desire to do something new with your career. Maybe you are considering becoming a Junior Database Administrator (DBA)?</p>
<p>Acquiring your very first role as a Junior DBA is no easy feat. Just browse any one of the many job sites advertising SQL Server DBA job vacancies you will quickly come to realise that almost all Junior positions list a number of years of SQL Server experience as a necessary requirement.</p>
<h3>How Most Junior DBA&#8217;s Earn Their Stripes</h3>
<p>The truth is that a significant proportion of SQL Server Database Administrators (DBA&#8217;s) start out in an alternative discipline, that is to say they are Accidental DBA&#8217;s. For example, a Windows Server<em> </em>Administrator may also be tasked with looking after the businesses SQL Server infrastructure, perhaps as the result of a DBA having left the company or through cross training opportunities within the organisation. These individuals acquire the necessary experience on the job within their existing role in order to make the transition to a Junior DBA position.</p>
<p>If you are seriously interested in either starting out on the path to becoming a SQL Server Database Administrator or perhaps wish to make a lateral move from an alternative IT discipline, this revelation can be quite disheartening. You may feel that it is somewhat of no win scenario, as right now you have limited experience working with SQL Server, hence why you are considering junior opportunities in the first place.</p>
<h3>Help is at Hand</h3>
<p>Well fear not my friend, for all is not lost. It may surprise you to hear that I am of the opinion that SQL Server experience alone is NOT the most desirable quality of a Junior DBA! You see the Accidental DBA will often be self taught and so although more experienced than perhaps you are currently, they have acquired their knowledge of SQL Server the hard way. The very same knowledge can be passed on to a newly hired Junior DBA by an experienced mentor in a fraction of the time. For this reason there are a number of very desirable qualities other than SQL Server experience alone, that can provide you with a serious edge over the competition.</p>
<p>Over the years I have interviewed many aspiring data professionals and I want to share with you what I look for when hiring Junior DBA&#8217;s.</p>
<p><strong><span style="text-decoration: underline;">My Top 10 Interview Tips for Junior DBA&#8217;s</span></strong><strong><span style="text-decoration: underline;"> </span></strong></p>
<h4><span style="color: #000080;">1. Are You a Problem Solver?</span></h4>
<p>At the core of being a successful Database Administrator is an ability and a drive to problem solve.</p>
<p>You need to be able to effectively demonstrate your passion for problem solving. Problem solving is not really a skill that you can teach but it can certainly be improved and enhanced through practice.</p>
<p>You must be able to demonstrate a good level of problem solving to the interviewer.</p>
<p>Be prepared for your interview whether it be face to face or over the telephone, with a whole host of examples that demonstrate your ability and flair to problem solve.</p>
<h4><span style="color: #000080;">2. Do You Know The Primary Responsibility of a DBA?</span></h4>
<p>Do you know what the <a title="The Primary Responsibility of a DBA" href="http://www.johnsansom.com/index.php/2009/07/the-database-administrators-primary-responsibility/">primary responsibility of a DBA</a> is? If not then you need to read this now! Think of it as the DBA Prime Directive. Everything that you do as a data professional is built on this.</p>
<h4><span style="color: #000080;">3. What do You Know About Database Backups?</span></h4>
<p>Ideally you should get to grips with the basics of SQL Server backups but as a very minimum you must know why they are necessary and why they are important.</p>
<h4><span style="color: #000080;">4. Why do You Want to be a DBA?</span></h4>
<p>I look for candidates who know why they want to be a Database Administrator. There is no right or wrong answer here but you must be able to demonstrate to the interviewer that your reasons are clear and have been thought out.</p>
<h4><span style="color: #000080;">5. Can you provide quality examples of your previous projects?</span></h4>
<p>You will almost certainly be quizzed by your interviewer on the details of your past projects. This will enable you to demonstrate a wealth of qualities about yourself.</p>
<p>The key is to ensure that you have prepared ahead of time, a number of projects that you can discuss with your interviewer. Although preferable, your examples do not have to be SQL Server Specific or even IT Project work for that matter. Anything from University projects to work experience or examples of problem solving from part time jobs. Just be sure to have sufficient detail readily available and clear in your mind.</p>
<p>This is your opportunity to demonstrate to the the interviewer any number of your qualities and skills. To get you started, you may with to consider how you can discuss your project work to demonstrate:</p>
<ul>
<li>Working      in groups</li>
<li>Working      independently and without supervision</li>
<li>Planning</li>
<li>Project      Management</li>
<li>Time      Management</li>
<li>Problem      Solving</li>
</ul>
<h4><span style="color: #000080;">6. Can you Demonstrate Overcoming Adversity?</span></h4>
<p>Be prepared to provide examples of how you have overcome problems or difficulties.</p>
<p>Show that you are keen to develop professionally by providing insight and evaluation of your own performance. Consider, ahead of time, how could you have done things differently?</p>
<h4><span style="color: #000080;">7. Do You Have a Basic Grasp of the Relational Model?</span></h4>
<p>You must at least learn and understand the fundamentals of <a title="The Relational Model" href="http://en.wikipedia.org/wiki/Relational_model">The Relational Model</a> before applying for a DBA position. There is simply no excuse in the Internet era for not having an overall understanding of the basics. Don&#8217;t like studying online then get yourself a good book. Perhaps <a title="Database Systems" href="http://www.amazon.co.uk/Database-Systems-Implementation-Management-International/dp/0321210255/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1262552494&amp;sr=8-2">Database Systems</a> by Connolly &amp; Beg would be a good place to start for you and is an excellent text used by many Computer Science Degree courses.</p>
<h4><span style="color: #000080;">8. Do you Have a Personal Development Plan?</span></h4>
<p>In order to be a data professional you have to continually be learning about your chosen subject. In an ideal world your employer would assist you with this endeavour however you should take charge of managing your own professional development. Your prospective employer may have budget to allocate to your training but may not know how it should be spent or what courses would be appropriate for you. Individuals that can clearly demonstrate that they are proactive about managing their own professional development are sought after.</p>
<p>Consider how you are going to increase your skills and knowledge of SQL Server. The more detailed your plans the more attractive a proposition you are to a perspective employer.</p>
<p>Some tips to get you started include:</p>
<ul>
<li>Join      your local SQL Server User Group</li>
<li>Study      for SQL Server Certifications such as MCTS or MCITP.</li>
<li>What      SQL Server texts are you currently reading and would like to read? You      have a reading list right?</li>
<li>Follow      SQL Server Bloggers by subscribing to their RSS feeds.</li>
<li>Follow      SQL Server DBA&#8217;s on Twitter to keep up to date on what&#8217;s going on the SQL      Server Community.</li>
<li>Visit      SQL Server Forums to both review questions and contribute answers.</li>
<li>Frequent      some of the many excellent SQL Server Community sites such as      <a title="SQL Server Central" href="http://www.sqlservercentral.com/">SQLServerCentral</a>, <a title="SQL Server Pedia" href="http://www.sqlserverpedia.com/">SQLServerPedia </a>and <a title="SQLTeam" href="http://www.sqlteam.com/">SQLTeam</a>.</li>
</ul>
<h4><span style="color: #000080;">9. Do You Have Any Goals?</span></h4>
<p>Ensure that you can provide details of both your short (within the next year) and medium term (next five years) goals. This may link in to your Professional Development plan but you may also wish to include details of your life goals. Again there is no right or wrong answer here, as the objective is to demonstrate that you are forward thinking and ambitious but if you want to get serious about your goals then you will want to make sure that they are <a title="SMART Goals" href="http://en.wikipedia.org/wiki/SMART_criteria">SMART</a> goals.</p>
<h4><span style="color: #000080;">10. Do You Know What You Don&#8217;t Know?</span></h4>
<p>The more you learn and the more experience you acquire, the more you will realise what you don&#8217;t know. Let me tell you now that there is not a single data professional that knows absolutely all there is to know about SQL Server. It is simply too large a subject. That is why there are specialist SQL Server roles, such as Database Developer, Database Administrator, Business Intelligence Analyst, Report Writer and many more.</p>
<p>The key point to take away here is that it is perfectly acceptable and expected for you to not know the answer to a particular SQL Server question or problem. Personally I consider it a strength to know what it is that you do not know. Knowing your limits means that you can identify when it is time to call in the cavalry.</p>
<p>When you are stumped by a question in your interview don&#8217;t panic! Simply tell the interviewer that this is not an aspect of SQL Server that you are currently familiar with and then immediately go on to explain, if possible, how you would go about finding out the information required. Remember, it&#8217;s all about problem solving. There will be times in you career as a data professional that you do not have the answer to an issue immediately before you but if you have the means to find the solution then you are indeed a valuable asset.</p>
<h3>What Are Your DBA Interview Tips?</h3>
<p>I&#8217;d love to know what are your DBA interview tips? Leave your thoughts and feedback below.</p>
<h3>Related Posts</h3>
<ul>
<li><a title="The Database Administrators Primary Responsibility" href="http://www.johnsansom.com/index.php/2009/07/the-database-administrators-primary-responsibility/">The      Database Administrators Primary Responsibility</a></li>
<li><a title="Blog Your Way to Becoming a Better DBA" href="http://www.johnsansom.com/index.php/2009/10/blog-your-way-to-becoming-a-better-dba/">Blog      Your Way to Becoming a Better DBA</a></li>
<li><a title="What it takes to be an outstanding DBA" href="http://www.johnsansom.com/index.php/2009/05/what-does-it-take-to-be-an-outstanding-sql-server-dba/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+JohnSansom%2FSQLServerpediaSyndication+%28John+Sansom+-+SQL+Server+DBA+in+the+UK%29">What it takes to be an Outstanding DBA</a></li>
<li><a title="How to get a Junior DBA Job" href="http://www.brentozar.com/archive/2009/04/how-to-get-a-junior-dba-job-part-1/">How to Get a Junior DBA Job</a></li>
<li><a title="Junior DBA Interview Questions" href="http://thomaslarock.com/2009/04/junior-dba-questions/">Junior DBA Interview Questions</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2010/02/top-10-junior-dba-interview-tips/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL Snippet: What SQL Server Agent Jobs were running at that time?</title>
		<link>http://www.johnsansom.com/index.php/2009/12/sql-agent-jobs-time-query/</link>
		<comments>http://www.johnsansom.com/index.php/2009/12/sql-agent-jobs-time-query/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 09:00:22 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[SQL Server administration]]></category>
		<category><![CDATA[SQL Server Jobs]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=1733</guid>
		<description><![CDATA[Here is a SQL Snippet that can be used to identify the SQL Server Agent Jobs that were running on a server at a particular point in time. This can come in very handy if you need to troubleshoot a performance issue after the fact and want to find out if there were any jobs [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a SQL Snippet that can be used to identify the SQL Server Agent Jobs that were running on a server at a particular point in time.</p>
<p>This can come in very handy if you need to troubleshoot a performance issue after the fact and want to find out if there were any jobs running on your server at a particular point in time retrospectively. The cumbersome alternative is to use a combination of the Job Activity Monitor,Job History and Schedules interfaces within SQL Server Management Studio (SSMS).</p>
<p>To use this snippet simply substitute in the DateTime that you are interested in.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #808080; font-style: italic;">/*--------------------------------------------------------------------------------------------------------------<br />
Date: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 29/12/09<br />
Author: &nbsp; &nbsp; &nbsp; &nbsp; John Sansom<br />
Description:&nbsp; &nbsp; Script to identify SQL Server Agent jobs that were <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; running on the server at a particular time<br />
----------------------------------------------------------------------------------------------------------------*/</span><br />
<br />
DECLARE @jobsRunningAt DATETIME;<br />
<br />
<span style="color: #808080; font-style: italic;">--Modify the value here to be the DateTime you are Interested in.</span><br />
<span style="color: #993333; font-weight: bold;">SET</span> @jobsRunningAt <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'2009/12/28'</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">WITH</span> JobHistorySummary <span style="color: #993333; font-weight: bold;">AS</span><br />
<span style="color: #66cc66;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jobs<span style="color: #66cc66;">.</span>job_id<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; job_name <span style="color: #66cc66;">=</span> jobs<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>name<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; step_id<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; step_name<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; run_time<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; run_time_hours <span style="color: #66cc66;">=</span> run_time<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; run_time_minutes <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; run_time_seconds <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span>%100<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; run_time_elapsed_seconds <span style="color: #66cc66;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span>run_time<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">10000</span> <span style="color: #808080; font-style: italic;">/*run_time_hours*/</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">60</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">60</span> <span style="color: #808080; font-style: italic;">/* hours to minutes to seconds*/</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span> <span style="color: #808080; font-style: italic;">/* run_time_minutes */</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">60</span> <span style="color: #808080; font-style: italic;">/* minutes to seconds */</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span>%100<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Start_Date <span style="color: #66cc66;">=</span> CONVERT<span style="color: #66cc66;">&#40;</span>DATETIME<span style="color: #66cc66;">,</span> RTRIM<span style="color: #66cc66;">&#40;</span>run_date<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Start_DateTime <span style="color: #66cc66;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CONVERT<span style="color: #66cc66;">&#40;</span>DATETIME<span style="color: #66cc66;">,</span> RTRIM<span style="color: #66cc66;">&#40;</span>run_date<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_time<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">10000</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">3600</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span>%100 <span style="color: #808080; font-style: italic;">/*run_time_elapsed_seconds*/</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">23.999999</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">3600</span> <span style="color: #808080; font-style: italic;">/* seconds in a day*/</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; End_DateTime <span style="color: #66cc66;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CONVERT<span style="color: #66cc66;">&#40;</span>DATETIME<span style="color: #66cc66;">,</span> RTRIM<span style="color: #66cc66;">&#40;</span>run_date<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_time<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">10000</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">3600</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span>run_time%10000<span style="color: #66cc66;">&#41;</span>%100<span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">86399.9964</span> <span style="color: #808080; font-style: italic;">/* Start Date Time */</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_duration<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">10000</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">3600</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>run_duration%10000<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">+</span> <span style="color: #66cc66;">&#40;</span>run_duration%10000<span style="color: #66cc66;">&#41;</span>%100 <span style="color: #808080; font-style: italic;">/*run_duration_elapsed_seconds*/</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">86399.9964</span> <span style="color: #808080; font-style: italic;">/* seconds in a day*/</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> msdb<span style="color: #66cc66;">.</span>dbo<span style="color: #66cc66;">.</span>sysjobs jobs <span style="color: #993333; font-weight: bold;">WITH</span><span style="color: #66cc66;">&#40;</span>NOLOCK<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> msdb<span style="color: #66cc66;">.</span>dbo<span style="color: #66cc66;">.</span>sysjobhistory history <span style="color: #993333; font-weight: bold;">WITH</span><span style="color: #66cc66;">&#40;</span>NOLOCK<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">ON</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jobs<span style="color: #66cc66;">.</span>job_id <span style="color: #66cc66;">=</span> history<span style="color: #66cc66;">.</span>job_id<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHERE</span> step_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'(Job outcome)'</span> <span style="color: #808080; font-style: italic;">--Only interested in final outcome of jobs</span><br />
<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <br />
&nbsp; &nbsp; job_id<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; job_name<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; Start_DateTime<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; End_DateTime<br />
<span style="color: #993333; font-weight: bold;">FROM</span> JobHistorySummary<br />
<span style="color: #993333; font-weight: bold;">WHERE</span> Start_DateTime <span style="color: #66cc66;">&lt;=</span> @jobsRunningAt <span style="color: #993333; font-weight: bold;">AND</span> End_DateTime <span style="color: #66cc66;">&gt;=</span> @jobsRunningAt<br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> End_DateTime <span style="color: #993333; font-weight: bold;">DESC</span>;</div></div>
<h2>Similar Posts</h2>
<ul>
<li><a title="Identify All Active SQL Server Sessions" href="http://www.johnsansom.com/index.php/2009/06/dmv-query-to-identify-all-active-sql-server-sessions/">Identify All Active SQL Server Sessions</a></li>
<li> <a title="Most Costly SQL Server Queries" href="http://www.johnsansom.com/index.php/2009/05/how-to-identify-the-most-costly-sql-server-queries-using-dmvs/?preview=true&amp;preview_id=499&amp;preview_nonce=25ddb9893e">How to identify the most costly SQL Server queries using DMV’s </a></li>
<li><a title="Highest SQL Server Waits by Percentage" href="http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/">Highest SQL Server Waits by Percentage</a></li>
</ul>
<p>I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any questions regarding this snippet, SQL Server Agent Jobs or anything whatsoever to do with SQL Server then feel free to ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/12/sql-agent-jobs-time-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL Snippet: SQL Server Wait Types</title>
		<link>http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/</link>
		<comments>http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 15:52:21 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Dynamic Management Views (DMV)]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[SQLServerWaitTypes]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=1704</guid>
		<description><![CDATA[Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) sys.dm_os_wait_stats in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time [...]]]></description>
			<content:encoded><![CDATA[<p>
Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) <a title="sys.dm_os_wait_stats" href="http://msdn.microsoft.com/en-us/library/ms179984%28SQL.90%29.aspx">sys.dm_os_wait_stats</a> in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time that a particular Wait Type is responsible for.
</p>
<p>
<strong>T-SQL Query to rank SQL Server Wait Types by highest percentage of total wait time</strong>
</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; wait_type<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; waiting_tasks_count<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; max_wait_time_ms<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; resource_wait_time_ms &nbsp;<span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; PercentOfAllResourceWaitTime <span style="color: #66cc66;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span>cast<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> decimal<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">19</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> sum<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_wait_stats<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">100</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_wait_stats<br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> PercentOfAllResourceWaitTime <span style="color: #993333; font-weight: bold;">DESC</span></div></div>
<p>
I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any queries regarding this snippet, SQL Server Wait Types or anything to do with SQL Server whatsoever then be sure to let me know!</p>
<h2>Further Reading</h2>
<ul>
<li>SQL Server Best Practice Article: <a title="SQL Server Best Practice Article: Performance Tuning Wait Queus" href="http://msdn.microsoft.com/en-us/library/cc966413.aspx">Performance Tuning Wait Queues</a></li>
<li>More DMV Queries: <a title="Identify All Active SQL Server Sessions" href="http://www.johnsansom.com/index.php/2009/06/dmv-query-to-identify-all-active-sql-server-sessions/">Identify All Active SQL Server Sessions</a></li>
<li>
How to identify the most <a title="How to identify the most costly SQL Server queries using DMVs" href="http://www.johnsansom.com/index.php/2009/05/how-to-identify-the-most-costly-sql-server-queries-using-dmvs/?preview=true&#038;preview_id=499&#038;preview_nonce=25ddb9893e">costly SQL Server queries</a> using DMV’s
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SQL Server Reporting Services Tip: email subscription tweak</title>
		<link>http://www.johnsansom.com/index.php/2009/07/permit-ssrs-subscription-email/</link>
		<comments>http://www.johnsansom.com/index.php/2009/07/permit-ssrs-subscription-email/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 12:24:00 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[Reporting Services Email Delivery]]></category>
		<category><![CDATA[SQL Server Reporting Services]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=760</guid>
		<description><![CDATA[What&#8217;s the problem? How to configure SQL Server Reporting Services 2005 to permit users to assign the delivery email address for their own subscriptions. Why does SQL Server work this way? When you subscribe to a report, the e-mail delivery settings you work with vary depending on whether your Role includes the &#8220;Manage individual subscriptions&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What&#8217;s the problem?</strong></p>
<p>How to configure SQL Server Reporting Services 2005 to permit users to assign the delivery email address for their own subscriptions.</p>
<p><strong>Why does SQL Server work this way?</strong></p>
<p>When you subscribe to a report, the e-mail delivery settings you work with vary depending on whether your <em>Role</em> includes the &#8220;Manage individual subscriptions&#8221; task or the &#8220;Manage all subscriptions&#8221; task. See <a title="E-Mail Delivery in Reporting Services" href="http://msdn.microsoft.com/en-us/library/ms160334.aspx">E-Mail Delivery in Reporting Services</a> for further information.</p>
<p>By default, a Reporting Services <em>user </em>cannot modify the email delivery target for their own subscriptions. Now providing a user the ability to Manage All Subscriptions on a given Report Server is not really a practical solution.</p>
<p><strong>How can I make it work my way?</strong></p>
<p>As an alternative what you can do is modify the security settings of the Report Server to allow a user to specify the delivery email address for their own subscriptions.</p>
<p>This requires a configuration change to the <a title="Report Server Configuration File" href="http://msdn.microsoft.com/en-us/library/ms157273.aspx">Report Server Configuration File</a></p>
<p>Modify the value for the &#8220;SendEmailToUserAlias&#8221; XML Attribtue to be “<strong>false</strong>” in order to permit any email address to be specified.</p>
<p>See <a title="Configuring A Report Server for Email Delivery" href="http://msdn.microsoft.com/en-us/library/ms159155.aspx">Configuring a Report Server for Email Delivery</a> for detailed instructions.</p>
<p><strong>Additional Considerations</strong></p>
<p><strong> </strong></p>
<p>If you are going to permit your Report Server users to be able to specifiy the delivery address for their subscriptions then it is wise in my opinon to also limit the Domains to which you permit delivery to, for example only trusted domains internal to the organisation. This can also be configured within the very same Report Server configuration file.</p>
<p>There you have it. Simple when you know how.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/07/permit-ssrs-subscription-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 5 SQL Server Forums</title>
		<link>http://www.johnsansom.com/index.php/2009/07/top-5-sql-server-forums/</link>
		<comments>http://www.johnsansom.com/index.php/2009/07/top-5-sql-server-forums/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 13:55:07 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[My Top 5]]></category>
		<category><![CDATA[SQL Server Forums]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[Best SQL Server Forums]]></category>
		<category><![CDATA[Top SQL Server Forums]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=745</guid>
		<description><![CDATA[As you no doubt already know, there is a ridiculously large amount of SQL Server Information available out there on the internet. Whether you&#8217;re browsing forums, web sites or blogs, knowing what the best sources of SQL Server information are and more importantly which one’s you can trust, can be tricky. So to help you [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_749" class="wp-caption alignright" style="width: 160px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: right;"><img class="size-thumbnail wp-image-749" title="Trophy" src="http://www.johnsansom.com/wp-content/uploads/2009/06/Trophy-150x150.png" alt="Top 5 SQL Server Forums" width="150" height="150" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Top 5 SQL Server Forums</p></div>
<p>As you no doubt already know, there is a ridiculously large amount of SQL Server Information available out there on the internet. Whether you&#8217;re browsing forums, web sites or blogs, knowing what the best sources of SQL Server information are and more importantly which one’s you can trust, can be tricky.</p>
<p>So to help you get started on the right track, below is my list of what I consider to be the Top 5 SQL Server Forums on the internet.</p>
<ol>
<li><a title="Stackoverflow" href="http://www.stackoverflow.com">StackOverflow</a></li>
<li><a title="SQL Server Central" href="http://www.sqlservercentral.com/">SQL Server Central</a></li>
<li><a title="ServerFault" href="http://www.serverfault.com/">ServerFault</a><a title="SQL Server Central" href="http://www.sqlservercentral.com/"></a></li>
<li><a title="Microsoft SQL Server Forums" href="http://social.msdn.microsoft.com/forums/en-US/category/sqlserver/">Microsoft MSDN SQL Server Forums</a></li>
<li><a title="SQLTeam" href="http://www.sqlteam.com/">SQLTeam</a></li>
</ol>
<p><span style="color: #888888;"><a title="Stackoverflow" href="http://www.stackoverflow.com/">StackOverflow</a></span></p>
<p style="padding-left: 30px;">There’s not a lot more I can say about this site that I have not done so already. Unlike the majority of technology forums currently out there, Stackoverflow covers more than just SQL Server, in fact a whole variety of technology related subject areas are catered for. I’m a real big fan of the site and for a detailed review read about my <a title="Stackoverflow Addiction" href="http://www.johnsansom.com/index.php/2009/01/stackoverflow-addiction/">Stackoverflow Addiction</a>.</p>
<p><a title="SQL Server Central" href="http://www.sqlservercentral.com/">SQL Server Central</a></p>
<p style="padding-left: 30px;">I consider this site to be a one stop SQL Server shop. Not only does it have one of the best SQL Server Forums on the internet but also a tremendous volume of SQL Server articles, blogs and general content. This is must view site for all SQL Server professionals.</p>
<p><a title="ServerFault" href="http://www.serverfault.com/">ServerFault</a></p>
<p style="padding-left: 30px;">This is the sister site to Stackoverflow and is all about hardware and administration. Given the ridiculously high level of expert knowledge and experience of some of the posters on the forum, I consider ServerFault to be an essential reference tool for all serious SQL Server Database Administrators.</p>
<p><a title="Microsoft SQL Server Forums" href="http://social.msdn.microsoft.com/forums/en-US/category/sqlserver/">Microsoft MSDN SQL Server Forums</a></p>
<p style="padding-left: 30px;">In my opinion this is the forum you go to when you have a seriously tough question you need answering. The community on this forum is quite close nit and perhaps a little cliquey at times but the quality of the detailed responses provided to queries is superb and the number of expert moderators on hand is second to none, thereby negating any down sides there may possibly be. There is also a separate forum for each SQL Server technology and feature, meaning that the community for each forum are experts in the specific subject area you need help on. Bottom line, if you cannot find an answer to your query elsewhere on the net then you will find it here!</p>
<p><a title="SQLTeam" href="http://www.sqlteam.com/">SQLTeam</a></p>
<p style="padding-left: 30px;">Another favourite of mine, this forum is well established and has been going for a good while now. That means that there is a wealth of knowledge there for you to get stuck into and a solid community of experienced SQL Server experts on hand to answer your queries.</p>
<p>There you have it, my Top 5 SQL Server Forums. I&#8217;m sure there are some other great undiscovered SQL Server resources out there. If you come across a great resource be sure to let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/07/top-5-sql-server-forums/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solutions to common T-SQL problems</title>
		<link>http://www.johnsansom.com/index.php/2009/06/solutions-to-common-tsql-problems/</link>
		<comments>http://www.johnsansom.com/index.php/2009/06/solutions-to-common-tsql-problems/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 13:13:17 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[T-SQL Common Problems]]></category>
		<category><![CDATA[T-SQL Solutions]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=780</guid>
		<description><![CDATA[Some of the moderators over at the MSDN SQL Server Forums have got together and collated a reference of solutions to common T-SQL problems. As always, all quality resources get added to the SQL Server Resrouces area of this site.]]></description>
			<content:encoded><![CDATA[<p>Some of the moderators over at the MSDN SQL Server Forums have got together and collated a reference of <a title="Solutions for Common T-SQL Problems" href="http://code.msdn.microsoft.com/SQLExamples">solutions to common T-SQL problems</a>.</p>
<p>As always, all quality resources get added to the <a title="SQL Server Resources" href="http://www.johnsansom.com/index.php/sql-server-resources/">SQL Server Resrouces </a>area of this site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/06/solutions-to-common-tsql-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate a random number in SQL Server</title>
		<link>http://www.johnsansom.com/index.php/2009/06/generate-a-random-number-in-sql-server/</link>
		<comments>http://www.johnsansom.com/index.php/2009/06/generate-a-random-number-in-sql-server/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 11:52:28 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server Tips]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[Random Number]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.johnsansom.com/?p=586</guid>
		<description><![CDATA[What is the best way to efficiently generate a random number in SQL Server? One of my favourite SQL Server authors, Michelle Ufford recently posted her method for generating a random number, in the post Random Number Generator in T-SQL. This got me thinking and I decided to do a little investigation of my own [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is the best way to efficiently generate a random number in SQL Server?</strong></p>
<p>One of my favourite SQL Server authors, <a title="Michelle Ufford SQL Fool" href="http://sqlfool.com/">Michelle Ufford </a> recently posted her method for generating a random number, in the post <a title="Random Number Generator in T-SQL" href="http://sqlfool.com/2009/06/random-number-generator-in-tsql/">Random Number Generator in T-SQL</a>. This got me thinking and I decided to do a little investigation of my own to identify what is indeed the best method to generate a random number in SQL Server.</p>
<p>Michelle proposes using the following method:</p>
<pre name="code" class="sql">
DECLARE @maxRandomValue TINYINT = 100, @minRandomValue TINYINT = 0;
SELECT CAST(((@maxRandomValue + 1) - @minRandomValue)
* RAND() + @minRandomValue AS TINYINT) AS 'randomNumber';</pre>
<p><br/></p>
<p>This is an excellent method and it also performs very well indeed however, it is exposed to the issue whereby repetitive invocations of RAND() in a single query will produce the same value. </p>
<p>To illustrate this, executing a query such as this:</p>
<pre name="code" class="sql">
SELECT TOP 10 RAND() AS [RandomNumber], [CustomerID], [CompanyName], [ContactName]
FROM [dbo].[Customers]
</pre>
<p>Produces results of the form below whereby the same random number is generated for each row:</p>
<pre>
RandomNumber         CustomerID CompanyName                          ContactName
-------------------- ---------- ----------------------------------- -------------------
0.21090395043234362  DSFR       SQL Server Gurus                     Brent Ozar
0.21090395043234362  FDJN       All Your Problems Solved             Denny Cherry
0.21090395043234362  FDSFSD     The Meaning of Life                  SQLBatman
0.21090395043234362  REWFD      It Depends                           Paul Randal
</pre>
<p><br/><br />
<strong>Using NEWID() When Repetitive Invocations are Required</strong></p>
<p>Incorporating the use of NEWID() function within the original query eliminates this problem.</p>
<pre name="code" class="sql">
DECLARE @maxRandomValue TINYINT = 100, @minRandomValue TINYINT = 0;
SELECT CAST(((@maxRandomValue + 1) - @minRandomValue)
* RAND(CHECKSUM(NEWID())) + @minRandomValue AS TINYINT) AS 'randomNumber';
</pre>
<p><br/><br />
<strong>Generating a Random Number Without Using RAND()</strong></p>
<p>For an alternative method to generate a random number without using the RAND() function you can do the following:</p>
<pre name="code" class="sql">
SELECT ABS(CAST(CAST(NEWID() AS VARBINARY) AS INT)) AS [RandomNumber]
</pre>
<p><br/></p>
<p>There you have it, two excellent approaches to generating random numbers in SQL Server T-SQL. I&#8217;ve no doubt that there are other excellent ways to do this and perhaps you know of some?</p>
<p><script src="js/shCore.js"></script> <script src="js/shBrushCSharp.js"></script></p>
<p><script src="js/shBrushXml.js"></script> <script type="text/javascript"><!--
dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
// --></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnsansom.com/index.php/2009/06/generate-a-random-number-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
