<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Adventures in SQL</title>
	
	<link>http://adventuresinsql.com</link>
	<description>Random thoughts, rants, discoveries and things I wish I had done better</description>
	<lastBuildDate>Wed, 05 Oct 2011 17:40:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AdventuresInSql" /><feedburner:info uri="adventuresinsql" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>AdventuresInSql</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>SQL University Troubleshooting Week: Having a Plan for Every Situation</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/xef7aiAevEU/</link>
		<comments>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-having-a-plan-for-every-situation/#comments</comments>
		<pubDate>Fri, 27 May 2011 15:00:51 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[SQL University]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=824</guid>
		<description><![CDATA[Today’s SQL University post will highlight the need to have a methodology to address issues that we as IT professionals may encounter in the course of our day. We will start off by looking at why we need to have a plan for every situation, and then we will dig into a methodology that I have developed by stealing bits and pieces of other people’s approaches over my career.  <a href="http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-having-a-plan-for-every-situation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlchicken.com/sql-university/"><img src="http://sqlchicken.com/wp-content/uploads/2010/11/SQL_University_Web1.png" alt="SQL University Logo" align="right"/></a>Today’s SQL University post will highlight the need to have a methodology to address issues that we as IT professionals may encounter in the course of our day. We will start off by looking at why we need to have a plan for every situation, and then we will dig into a methodology that I have developed by stealing bits and pieces of other people’s approaches over my career. </p>
<p>
Most IT professionals lean on either knowledge, instinct or some mix of the two to solve the problems that they encounter. Knowledge and instinct are powerful tools that develop with experience. In the case of knowledge, we can rely on the experience of those that are gracious enough to share their experience via books, blogs etc. to make us all stronger. Instinct is a much harder developed tool. There is no way to do a Bing search to see if you have experienced a similar situation before and how you reacted to it.</p>
<p>
What happens if we encounter a completely new problem that nobody has ever experienced before? Instinct and knowledge both require experience to move forward but there is none to draw from. At this point there is a real chance of getting caught up in what I like to call the Reaction Cycle. The Reaction Cycle is the technological quicksand that waits for us outside of our knowledge or when we are misled by our instincts. We apply an opposite force without thought, iteratively making things worse.</p>
<p>
Think of the Reaction Cycle in terms of a brand new junior DBA. One day while the rest of the team is off at lunch they start getting alerts from the production sales database. From the alerts it appears that the server briefly lost its connection to the SAN and now there is some database corruption. The junior DBA, seeing all of the disk errors, decides the box needs a reboot while most of the company is still at lunch and proceeds to kick it over. When the server comes back up there are multiple inaccessible databases.  By this time help has arrived, the rest of the team has returned from lunch. They quickly decide that at this point the best option they have is to restore the databases. They will lose some data but since this happened over lunch it is not the end of the world. They all agree that this is much faster than trying to work through the database corruption; after all they need to react quickly before too much money is lost. As they are restoring the sales database they discover they cannot apply transaction logs after 4 AM. A little further digging reveals that the junior DBA reacted to an alert about a log filling last night by truncating the database log. At this point the production database is gone and they have to go with what they have. 8 hours of sales are now gone due to the Reaction Cycle. </p>
<p>
Shrinking databases might be said to kill kittens but reacting can definitely kill a career. When something goes wrong, your first step is to collect information. What is wrong? What do the logs say? If you have an error message then what does Bing say about it?</p>
<p>
The next step is to process the information that was gathered. Based on the facts and data collected you can begin to formulate a response to what is going on. Sometimes based on this you need to go back and collect more data, like if you decide you need to restore you may want to try out the restore to a development server to make sure you have all the steps down.</p>
<p>
Finally, after all the collecting and processing it is time to respond. What we are doing here is making a carefully planned move based on based upon the collection and processing we have done in the previous steps. We almost always know at least our next move if not the next couple of moves and we have thoughts on what may go wrong and how we would respond to that.</p>
<p>
After responding we start over with the collection phase and move into the processing phase. Did we get the results we wanted? Are things better or worse? We continue to cycle through this process until we find no response is necessary.</p>
<p>
With that, it is time to unveil the Collect, Process, Respond methodology for troubleshooting. In simple terms, we want to gather all necessary data to develop a plan then execute it. Feel free to print the image below and hang it on your cube wall to remind you to use the methodology.<br />
<img src="/wp-content/uploads/2011/05/CollectProcessRespond.png" alt="Collect, Process, Respond" width="100%"/><br />
Now that we have covered why it is important to have a methodical approach to problem solving and taken a high level look at the Collect, Process, Respond methodology it is time to start digging into the individual phases.</p>
<p>
The first phase we are going to dig into is the Collect phase. The most important thing about the Collect phase is that only 1 person does the data collection per system. With multiple people collecting data from the same system the risk of reacting to monitoring induced symptoms goes up exponentially. A good example of this is if someone fires up a Profiler trace on a server to collect data about an issue while someone else is looking at active user sessions. The person monitoring user sessions may see the sessions start to pile up but not get back to the source of the waits before the trace is stopped. This could lead to user sessions piling up being misattributed as a symptom of the problem rather than a necessary byproduct of troubleshooting. If it is truly necessary to have more than 1 person collect data from a system then 1 person has to call the shots and everyone has to communicate well.</p>
<p>
The Collect phase is where we start scoping the issue or figuring out how wide to cast the net. I like to refer to it as ruling things in. We want to err on the side of ruling things in because it is easy for knowledgeable people to rule them out later. Remember our goal here is to figure out what is wrong.</p>
<p>
So how do we go about actually collecting data? I like to ask these questions:</p>
<li>What are the Symptoms?</li>
<li>What Locations are involved?</li>
<li>What Systems are involved?</li>
<li>What Changed?</li>
<li>What is in the Logs?</li>
<li>What are the Performance Indicators showing?</li>
<p><p>
The starting point for the Collect phase is to look at what the symptoms are. This is a key question because it helps us figure out what to collect. The symptoms may even tell us exactly what is wrong. If users are reporting a SQL Server error message about an account being locked it then it becomes easy to know what is going on and we can jump to the Process phase.</p>
<p>
Once we know the symptoms we want to look at what locations are involved. This is very important because it helps define the scope of further collection activities. If all users in a particular location are having issues then we would want to focus on what is unique to that location, but if all users in the company are having issues then we would want to look at what is common to all.</p>
<p>
Based on the answers to the previous questions it is now time to start looking at what systems might be involved. The goal of this step is to find all of the moving parts that make up whatever activity it is that is failing. This step often includes web servers, network load balancers and SANs so it is important to start bringing in other teams at this point.</p>
<p>
The last of the generalist tasks to get through before really digging in with the tools that we are comfortable with is to review the change control history. Many organizations have a calendar on a wiki or on SharePoint, sometimes there is even a log at the NOC in organizations large enough to have one. Worst case, talk to the primary on-calls or managers of systems that you may be involved to find out what changed lately. Spend some time here; almost everything that goes wrong is because of a change that someone implemented.</p>
<p>
Finally, we get down to the part that DBAs love. We get to bust out our magical tools that we are so used to using. I always save this for last because it is easy to get lost in the data, especially if it feels like it is leading us somewhere. This is where you would go trolling on any involved servers looking for any data that supports what you have seen earlier or anything that does not match with established baselines or in absence of formal baselines then anything that does not look the way you are used to seeing it.</p>
<p>
There are a number of third party tools to automate information gathering. Microsoft has the Management Data Warehouse and the Performance Dashboards. The great thing about these tools is they tell you at a glance what the important metrics are and usually have some sort of indicator when things are bad.</p>
<p>
Remember to be careful not to react while collecting data, the idea here is to gather as much useful information as possible.</p>
<p>
At this point we have collected all of the information we think we need and it is time to move into the Process phase. This is most people’s favorite phase because it feels the most like solving the problem but it is important to remember that we are not pushing any buttons or pulling any levers at this point. This phase is all about the making a plan to address the issue. You want to come away from this phase with an action plan, an expected result and a plan to rollback whatever action you take in case it makes things worse.</p>
<p>
As we move from the Collection phase to the Process phase we need to ask these questions:</p>
<li>Are there any obvious signs of trouble?</li>
<li>Can the problem be linked to a change?</li>
<p><p>
There is a reason that I have listed these questions first. These are the things that will let us short circuit out of the Collect phase. It pays to keep them in mind when working through the Collect phase to avoid prolonging outages with unnecessary analysis. A good example of a short-circuit out of the Collect phase would be if one of the symptoms was an error message stating that a SQL login was locked out. The problem is clear and the solution is simple and low risk. The follow-up monitoring is simply to make sure that the account does not lock out again. The trick here is to make sure that your intentions are in the right place. Be especially aware of decisions made to make you look good or avoid looking bad.</p>
<p>
Next we have to look at the data we collected to see if any patterns can be identified. As patterns emerge theories will develop. It is important to create at least one test for each theory. I say at least one because we may have multiple moving parts and each moving part should get a test. Say that a client application hosts a Reporting Services report is slow, we would want to first run the report by calling it directly in a web browser. If it is slow in the browser then we would want to start looking at the parts that make it up, eventually pulling out individual queries and running them in a query window. We will eventually get to what the problem is.</p>
<p>
A clearly defined problem almost always indicates what corrective action is necessary. To keep with the above example we may say the report is slow because the query to get customer orders for the last 10 years is missing an index. There are times when no matter how well defined the problem is the answer is not clear. In those cases having a clearly defined problem is invaluable in enlisting external help whether they are from another team or from a vendor. It is the only way to make sure you are asking for the right kind of help.</p>
<p>
Once a list of possible actions is developed it is important to stack-rank the possible solutions by likelihood of success. The goal is to try the action that is most likely to resolve the issue while exposing you to the smallest amount of risk. I always recommend trying things out in another environment first. It helps get the steps and timing down and it exposes weaknesses in the plan so that the plan can be properly ranked. Think about this in terms of a situation where you have unrecoverable database corruption and short circuit all the way to this step, would you immediately start a point in time restore to production or would you try it out on another server first to make sure that your backup is good and that you have a bullet-proof script?</p>
<p>
The last thing to do before moving on to the Respond phase is to define how to measure whether the change helped or made things worse. I like to define a measure for each benefit and each risk that I identified while ranking the possible actions. I might say that adding this index will reduce reads from 10,000 to 6 or that adding this index may cause inserts into the table to take longer. I may also say that if the index does make inserts slower and page splits are noticeably higher then I may alter the fill factor of the index. It really pays to define success and failure here to make it clear when to stay, when to rollback and when to tweak the implementation.</p>
<p>
More than anything, you really need to make sure you have thought things out and are doing what is right for the situation you are facing and not doing something like rebooting because that is what you always do first.</p>
<p>
The first step in the Respond phase is to communicate your intentions. Depending on the type of change you might just tell the rest of your team or you may have to through change control to get approval to do something. The more involved or risky the action you are going to take the more documentation you should have and the more people you should involve to make sure you are not missing anything. Think of it like pool where the shot doesn’t count unless you call it.</p>
<p>
Next we make the change. To make the change we follow a written plan that we have hopefully rehearsed. Granted unlocking a user’s account is something you have done 100 times so you can say that is well rehearsed but how many times have you rebuilt the passive node of a production database cluster? Use your best judgment here, erring on the side of being conservative.</p>
<p>
A single person should make the change so that the plan can be followed step by step. If something is missing from the plan then it should be added to the plan in case these steps need to be followed again or reversed to roll back the change.</p>
<p>
After all that, it is time to go back and start collecting data again. The issue is closed when there are no more symptoms to be addressed and no more fixes to be deployed.</p>
<p>
So there you have it, a flexible, scalable methodology for solving just about any problem that any of us might face in the IT world. Use it well.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=xef7aiAevEU:LwRtgXPPPw0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=xef7aiAevEU:LwRtgXPPPw0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=xef7aiAevEU:LwRtgXPPPw0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=xef7aiAevEU:LwRtgXPPPw0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=xef7aiAevEU:LwRtgXPPPw0:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/xef7aiAevEU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-having-a-plan-for-every-situation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-having-a-plan-for-every-situation/</feedburner:origLink></item>
		<item>
		<title>SQL University Troubleshooting Week: Keeping an Open Mind</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/HUO-YPb0UrU/</link>
		<comments>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-keeping-an-open-mind/#comments</comments>
		<pubDate>Thu, 26 May 2011 16:28:08 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[SQL University]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=812</guid>
		<description><![CDATA[Having a good attitude is key to success in the information technology field. Keeping an open mind is central to that. By going with the flow and looking at issues from the right perspective we can solve problems faster while becoming known for our skill and professionalism. <a href="http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-keeping-an-open-mind/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlchicken.com/sql-university/"><img src="http://sqlchicken.com/wp-content/uploads/2010/11/SQL_University_Web1.png" alt="SQL University Logo" align="right"/></a>Office politics during a major event can be dangerous. It pays to be seen as contributing to solving the problem rather than being seen as a part of it. We may have the best intentions and know our systems inside and out but if we refuse to look into something because we are sure it is not our issue then we are going to be seen as difficult and argumentative. If it turns out we are wrong and it is our issue we could even be seen as hiding something.</p>
<p>
I like to use the example of the rip current to explain office politics during a system outage. Unfamiliar swimmers caught in rip currents typically make the mistake of swimming against the current trying to get directly back to shore. Many get exhausted before they get back to shore and drown. Swimmers familiar with rip currents will go with the flow, swimming parallel to the shore until they are out of the current then swim back to shore.</p>
<p>
Keeping with the rip currents example, what happens when you fight people and say it is not your issue? Do they give up and go away; leaving you to what you were working on or do they fight you harder to prove it is your issue? At times it may even seem like their goal is not prove it is your issue but prove that you are being arrogant and that it could be. Many times it becomes less about the issue at hand and more about winning an argument. </p>
<p>
The simple truth is that it is better to go with the flow because it is faster. </p>
<p>
An important part of going with the flow is to construct tests that prove that something is our issue. Notice how I say to prove it is our issue rather than prove it is not. The human brain is incredibly open to having tricks played on it, by constructing an affirmative test we trick our brain into trying to find a way to make the test work. We are not happy with just a single failure to recreate the issue, we need to change the test scenario and test more until we can recreate the issue or run out of test scenarios. Most importantly, we are engaged and working to understand what is really going on.</p>
<p>
Having a good attitude is key to success in the information technology field. Keeping an open mind is central to that. By going with the flow and looking at issues from the right perspective we can solve problems faster while becoming known for our skill and professionalism.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=HUO-YPb0UrU:ZIeuSpNQvzI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=HUO-YPb0UrU:ZIeuSpNQvzI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=HUO-YPb0UrU:ZIeuSpNQvzI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=HUO-YPb0UrU:ZIeuSpNQvzI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=HUO-YPb0UrU:ZIeuSpNQvzI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/HUO-YPb0UrU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-keeping-an-open-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-keeping-an-open-mind/</feedburner:origLink></item>
		<item>
		<title>SQL University Troubleshooting Week: Communication</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/bdI3uMAUunk/</link>
		<comments>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-communication/#comments</comments>
		<pubDate>Tue, 24 May 2011 15:00:55 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[SQL University]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=801</guid>
		<description><![CDATA[It should come as no surprise that the first topic I am covering this week is communication because the first thing I think anyone should do is communicate that they are troubleshooting an issue. This post will cover why we should communicate then dig into how to put together an initial alert. The rest of the post will be spent talking about how to communicate updates and the resolution. <a href="http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-communication/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlchicken.com/sql-university/"><img src="http://sqlchicken.com/wp-content/uploads/2010/11/SQL_University_Web1.png" alt="SQL University Logo" align="right"/></a>It should come as no surprise that the first topic I am covering this week is communication because the first thing I think anyone should do is communicate that they are troubleshooting an issue. This post will cover why we should communicate then dig into how to put together an initial alert. The rest of the post will be spent talking about how to communicate updates and the resolution.</p>
<p>
First and foremost communication prevents your management from being caught by surprise when the VP of Sales calls to ask when they will be able to place orders again. </p>
<p>
Communication also prevents duplicated efforts. Many times when a system is down trouble reports come in from everywhere and go to everyone, resulting in a situation where there is no clear problem definition or problem owner. Communicating the problem owner allows the information to flow to a central place, allowing the problem to be properly defined.</p>
<p>
Finally, communication allows people to speak up about a recent change. If another team made a change recently they may be able to identify aspects of the issue you are working on that may be related to what they did. This is not saying someone was doing something sneaky although that sometimes happens. Usually this means that something was done and communicated to all the right people but not fully understood by the people it was communicated to or lost in turnover between support rotations. Assume the best here because you need people to speak up sooner rather than later. Treating them badly when they do speak up will only cause trouble in the long run.</p>
<p>
So what is the best way to communicate that there is a system issue? It helps to have an email group that includes all IT on-call pagers, management and other key people. If you do not have one I suggest setting one up solely for communicating large issues. It is important not to spam this list, treat it like pulling a fire alarm. It should only be used to communicate system issues from discovery through resolution with updates at regular intervals or large milestones throughout the process.</p>
<p>
It is also very important that the distribution list for these emails is IT only. People outside of IT may not know the intricacies of your particular implementation leading to the possibility of spreading misinformation. They are not doing this on purpose, they think they understand and like being involved in something exciting; that they are helping get the word out; doing their part. Let your management craft the organizational communications, they will have to answer for what is said in them.</p>
<p>
When sending alert emails keep the subject line general. If you give too much information in the subject line then people can assume it is not their issue and move on. We want to take advantage of that little pit in their stomach that everyone gets when something breaks to get them up to speed on the issue.</p>
<p>
Finally, the body of the email should provide a broad overview of the issue including what systems are impacted, any major symptoms including error messages, the number of people impacted and any location specific information. It is very important to keep to the important points here. The body of the email must be short enough to be fully read while long enough to include all important information. </p>
<p>
The body of your email should also contain a listing of any resources you need. If you need people then say I will be contacting the primary on-call from network engineering etc. to get their attention. Never use a mass communication to say “I cannot find Mike from the server team. If anyone sees him please tell him I need his help on this issue.” It will make both of you look bad and make the person on the receiving end less likely to help.</p>
<p>
Finally, only state the facts when communicating an issue and never assign blame. This is such an important part of the communication. It is important to only state what you know. What you think is not important and who is to blame is even less important. In the end the person that fixes the problem will be asked to explain what went wrong. Chances are they either made the change that led up to the issue or know who did. If there was a hardware failure they will be able to explain it in-depth as well.  If you have any doubt about what you are communicating then check with someone that knows more about that particular area.</p>
<p>
Once the first alert is sent you generally have 30 minutes to either fix the issue or convene a war room. 30 minutes is a loose rule that I use because if the fix is easy then you will almost always identify the issue, develop a plan and fix it within that time. If 30 minutes goes by and you are still trying to figure out what is wrong then it is time to ask for help. Either way a follow-up alert should go out at the 30 minute mark to update everyone on the issue. The update should follow the same rules as the initial alert although the subject line should be prefixed with “UPDATE: “. Updates should continue at regular intervals until the issue is resolved.</p>
<p>
At some point all issues get resolved and that also needs to be communicated. The resolution should include the subject line of the original alert prefixed with “RESOLVED:“. Due to the potential for wide distribution, the alert should never mention anyone by name. The alert should contain a factual description of what the issue was and what was done to solve it, because facts are just facts and cannot convey opinions. Conclusions on the other hand, can convey opinions. Put the facts out there and let people draw their own conclusions. All that really matters is that the people in a position to prevent such a thing in the future recognize what happened and take actions to either prevent or mitigate the impact in the future.</p>
<p>
I hope you can see why I think properly communicating issues is important. I have outlined a system that has worked well for me. I strongly believe that anyone handling communications in this manner will be recognized for their professionalism and leadership. </p>
<p>
What works for you? Please feel free to leave it in the comments below.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bdI3uMAUunk:zsNFyN5PhnE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bdI3uMAUunk:zsNFyN5PhnE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=bdI3uMAUunk:zsNFyN5PhnE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bdI3uMAUunk:zsNFyN5PhnE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=bdI3uMAUunk:zsNFyN5PhnE:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/bdI3uMAUunk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-communication/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-communication/</feedburner:origLink></item>
		<item>
		<title>SQL University Troubleshooting Week: Syllabus</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/Cx975oUvDgo/</link>
		<comments>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-syllabus/#comments</comments>
		<pubDate>Mon, 23 May 2011 17:17:23 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[SQL University]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=786</guid>
		<description><![CDATA[I am honored to close out the final week of the Spring 2011 semester with a topic that I really enjoy: Troubleshooting. I really enjoy solving problems and that has caused me to get pulled into many situations where I could use and develop my troubleshooting skills. I hope to share the things I have learned here this week to speed everyone along in the process, hopefully avoiding some of the pitfalls that I had along the way.  <a href="http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-syllabus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlchicken.com/sql-university/"><img src="http://sqlchicken.com/wp-content/uploads/2010/11/SQL_University_Web1.png" alt="SQL University Logo" align="right"/></a>Welcome to SQL University Troubleshooting Week. For anyone unfamiliar with SQL University, it is a project created by Jorge Segarra (<a href="http://sqlchicken.com/">Blog</a>|<a href="http://twitter.com/#!/SQLChicken">Twitter</a>) to give people a free way to learn SQL Server from the ground up. The professors at SQL University are bloggers with one or more of them getting a week to cover their topic.</p>
<p>I am honored to close out the final week of the Spring 2011 semester with a topic that I really enjoy: Troubleshooting. I really enjoy solving problems and that has caused me to get pulled into many situations where I could use and develop my troubleshooting skills. I hope to share the things I have learned here this week to speed everyone along in the process, hopefully avoiding some of the pitfalls that I had along the way. </p>
<p>I tried to keep the posts short and easily digestible but I will warn you now that there are one or two that are a bit long. Here is what I have planned for this week:</p>
<li><strong>Communication</strong> &#8211; Why it is good to communicate during system issues and how to get the word out effectively.</li>
<li><strong>Keeping an Open Mind</strong> &#8211; Having the right attitude means being courageous enough to put ego aside, looking at things from a different perspective.</li>
<li><strong>Having a Plan for Every Situation</strong> &#8211; You may not know what is going to happen next but you can still have a plan to deal with it.</li>
<p>&nbsp;<br />
I hope to cover something useful for every level this week. Even as I wrote these posts I was reminded of things I could have done better in recent situations. Look for the &#8220;Communication&#8221; post tomorrow with &#8220;Keeping an Open Mind&#8221; on Thursday and &#8220;Having a Plan for Every Situation&#8221; on Friday. Friday&#8217;s post is quite long so it will make for good weekend reading.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Cx975oUvDgo:JCnp1FVjIi4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Cx975oUvDgo:JCnp1FVjIi4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=Cx975oUvDgo:JCnp1FVjIi4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Cx975oUvDgo:JCnp1FVjIi4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=Cx975oUvDgo:JCnp1FVjIi4:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/Cx975oUvDgo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-syllabus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/05/sql-university-troubleshooting-week-syllabus/</feedburner:origLink></item>
		<item>
		<title>SQL Saturday 67 Slides Are Now Available</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/UpE0FxlpEHs/</link>
		<comments>http://adventuresinsql.com/2011/04/sql-saturday-67-slides-are-now-available/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 04:07:25 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=773</guid>
		<description><![CDATA[I recently debuted a new presentation, "What To Do When It All Goes So Wrong". The presentation is designed to give Database Administrators a basic overview of the skills they need to handle virtually any crisis that may arise. While the target audience is DBAs, I feel that most IT Professionals can benefit from the concepts.  <a href="http://adventuresinsql.com/2011/04/sql-saturday-67-slides-are-now-available/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently debuted a new presentation, &#8220;What To Do When It All Goes So Wrong&#8221;. The presentation is designed to give Database Administrators a basic overview of the skills they need to handle virtually any crisis that may arise. While the target audience is DBAs, I feel that most IT Professionals can benefit from the concepts. </p>
<p>The first delivery of the presentation went well, although I definitely have some ideas for how I can improve on it. Look for this deck to evolve a bit over time. The biggest area that I still feel needs work is the narrative around the emergency scenario that I created. Right now it does not tie as well as I would like with the concepts later on in the presentation. Look for the narrative to develop more as I get more opportunities to deliver this presentation. </p>
<p>You can get to the deck from my <a href="http://adventuresinsql.com/presentations/">Presentations</a> page. Yep, that&#8217;s right, I have a presentations page now. It feels good to finally have enough content to warrant a dedicated page.</p>
<p>Please have a look and feel free to leave any feedback you might have in the comments section on that page.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=UpE0FxlpEHs:FlxpkLGTbOk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=UpE0FxlpEHs:FlxpkLGTbOk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=UpE0FxlpEHs:FlxpkLGTbOk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=UpE0FxlpEHs:FlxpkLGTbOk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=UpE0FxlpEHs:FlxpkLGTbOk:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/UpE0FxlpEHs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/04/sql-saturday-67-slides-are-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/04/sql-saturday-67-slides-are-now-available/</feedburner:origLink></item>
		<item>
		<title>Looking Up Email Addresses with PowerShell</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/9g4oyjfg7lU/</link>
		<comments>http://adventuresinsql.com/2011/01/looking-up-email-addresses-with-powershell/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 17:30:19 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=733</guid>
		<description><![CDATA[A week or so ago Aaron Nelson put out a call for help on Twitter looking for anyone that could help with adding autocomplete for looking up an email address to a PowerShell forms application. The original request was to look up the user in the Global Address List (GAL) via Outlook but after some thought we decided to switch to looking up the recipients Active Directory (AD), allowing the search to work on machines that do not have Outlook installed...like servers. I will walk through both functions then provide a quick and dirty test application so you can try out the code for yourself.
 <a href="http://adventuresinsql.com/2011/01/looking-up-email-addresses-with-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A week or so ago Aaron Nelson (<a href="http://sqlvariant.com/wordpress/">Blog</a>|<a href="http://twitter.com/SQLvariant">Twitter</a>) put out a call for help on Twitter looking for anyone that could help with adding autocomplete for looking up an email address to a PowerShell forms application. The original request was to look up the user in the Global Address List (GAL) via Outlook but after some thought we decided to switch to looking up the recipients via Active Directory (AD), allowing the search to work on machines that do not have Outlook installed&#8230;like servers. I will walk through both functions then provide a quick and dirty test application so you can try out the code for yourself.</p>
<p>The first function I want to show is the one to look up a recipient via Outlook. Despite its limited application this is the more interesting code block to me. I love that I only had to pass a partial name to get back the closest match from the GAL. I chose to include the instantiation of the $outlook object in this function because it made for a more clear example. If I were writing production code I would likely declare $outlook as a global variable then just instantiate it in this function if it had not been already. A great source for more information on calling into Outlook from PowerShell is <a href="http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx">this article</a>.</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">Load</span>WithPartialname<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.Office.Interop.Outlook&quot;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #0000FF;">Function</span> get<span style="color: pink;">-</span>emailOutlook<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>System.String<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Microsoft.Office.Interop.Outlook.Application<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$outlook</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> Outlook.Application<br />
&nbsp; &nbsp; <span style="color: #800080;">$item</span> <span style="color: pink;">=</span> <span style="color: #800080;">$outlook</span>.Session.GetGlobalAddressList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.AddressEntries.Item<span style="color: #000000;">&#40;</span><span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$item</span>.Name<br />
&nbsp; &nbsp; <span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$item</span>.GetExchangeUser<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.PrimarySmtpAddress<br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>The other way to get after this information is via Active Directory. My feeling is that this is going to be the preferred method for most people to look up email addresses. The exception would be those people that want to be able to look up contacts from outside their organization in their local address book. Going the AD route took a few more lines of code, but was still quite easy. The big difference here is that we had to define a search filter by applying the wildcard symbol, &#8220;*&#8221;, to the portion of the recipient name that had been typed so far. The other big thing to notice is that checks to make sure the results are not null had to be added because unlike the Outlook this search may not return any results. I found <a href="http://technet.microsoft.com/en-us/library/ff730963.aspx">this article</a> incredibly helpful in putting this function together.</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">Function</span> get<span style="color: pink;">-</span>emailAD<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>System.String<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>System.DirectoryServices.DirectorySearcher<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searcher</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.DirectoryServices.DirectorySearcher<br />
&nbsp; &nbsp; <span style="color: #800080;">$searcher</span>.<span style="color: #0000FF;">Filter</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;(&amp;(objectCategory=User)(Name=$searchString*))&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$path</span> <span style="color: pink;">=</span> <span style="color: #800080;">$searcher</span>.FindOne<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$path</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$user</span> <span style="color: pink;">=</span> <span style="color: #800080;">$path</span>.GetDirectoryEntry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$user</span>.name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$user</span>.mail<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>That does it for the functions. Now for the test harness. This code is not terribly pretty and could probably be made more robust but it seems to work well enough for me to demonstrate the calls. The one thing that I had thought I would need to add is multi-threading to work like AJAX, but since the code runs so much faster than the HTTP calls you would see with AJAX it seems unnecessary. If the lookups run slowly in your environment then it would make sense to add some threading logic. With that, here is the code for the test harness:</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;System.Drawing&quot;</span><span style="color: #000000;">&#41;</span> <br />
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;System.Windows.Forms&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">Load</span>WithPartialname<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.Office.Interop.Outlook&quot;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #0000FF;">Function</span> get<span style="color: pink;">-</span>emailAD<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>System.String<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>System.DirectoryServices.DirectorySearcher<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searcher</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.DirectoryServices.DirectorySearcher<br />
&nbsp; &nbsp; <span style="color: #800080;">$searcher</span>.<span style="color: #0000FF;">Filter</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;(&amp;(objectCategory=User)(Name=$searchString*))&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$path</span> <span style="color: pink;">=</span> <span style="color: #800080;">$searcher</span>.FindOne<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$path</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$user</span> <span style="color: pink;">=</span> <span style="color: #800080;">$path</span>.GetDirectoryEntry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$user</span>.name<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$user</span>.mail<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">Function</span> get<span style="color: pink;">-</span>emailOutlook<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>System.String<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Microsoft.Office.Interop.Outlook.Application<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$outlook</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> Outlook.Application<br />
&nbsp; &nbsp; <span style="color: #800080;">$item</span> <span style="color: pink;">=</span> <span style="color: #800080;">$outlook</span>.Session.GetGlobalAddressList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.AddressEntries.Item<span style="color: #000000;">&#40;</span><span style="color: #800080;">$searchString</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$item</span>.Name<br />
&nbsp; &nbsp; <span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800080;">$item</span>.GetExchangeUser<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.PrimarySmtpAddress<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">Function</span> get<span style="color: pink;">-</span>email<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>System.Int32<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$location</span> <span style="color: pink;">=</span> <span style="color: #800080;">$name</span>.SelectionStart<br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$location</span> <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">return</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$useOutlook</span>.Checked <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; get<span style="color: pink;">-</span>emailOutlook <span style="color: pink;">-</span>searchString <span style="color: #800080;">$name</span>.Text.Substring<span style="color: #000000;">&#40;</span><span style="color: #804000;">0</span><span style="color: pink;">,</span><span style="color: #800080;">$location</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; get<span style="color: pink;">-</span>emailAD <span style="color: pink;">-</span>searchString <span style="color: #800080;">$name</span>.Text.Substring<span style="color: #000000;">&#40;</span><span style="color: #804000;">0</span><span style="color: pink;">,</span><span style="color: #800080;">$location</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$name</span>.SelectionStart <span style="color: pink;">=</span> <span style="color: #800080;">$location</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.Form<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$form</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.Form <br />
<span style="color: #800080;">$form</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">'Autocomplete Tester'</span><br />
<span style="color: #800080;">$form</span>.Size <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">400</span><span style="color: pink;">,</span> <span style="color: #804000;">200</span><span style="color: #000000;">&#41;</span> <br />
<span style="color: #800080;">$form</span>.StartPosition <span style="color: pink;">=</span> <span style="color: #800000;">'CenterScreen'</span><br />
<span style="color: #800080;">$form</span>.KeyPreview <span style="color: pink;">=</span> <span style="color: #800080;">$true</span> <br />
<span style="color: #800080;">$form</span>.Add_KeyDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.KeyCode <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">'Enter'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #800080;">$name</span>.SelectionStart <span style="color: pink;">=</span> <span style="color: #800080;">$name</span>.TextLength;$email.Visible <span style="color: pink;">=</span> <span style="color: #800080;">$true</span>;<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$form</span>.Add_KeyDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.KeyCode <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">'Escape'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #800080;">$form</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.Label<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$nameLabel</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.Label<br />
<span style="color: #800080;">$nameLabel</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Name to Search for:&quot;</span><br />
<span style="color: #800080;">$nameLabel</span>.Width <span style="color: pink;">=</span> <span style="color: #804000;">110</span><br />
<span style="color: #800080;">$nameLabel</span>.Location <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">20</span><span style="color: pink;">,</span> <span style="color: #804000;">50</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$form</span>.Controls.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$nameLabel</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.TextBox<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$name</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.TextBox<br />
<span style="color: #800080;">$name</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">''</span><br />
<span style="color: #800080;">$name</span>.Width <span style="color: pink;">=</span> <span style="color: #804000;">200</span><br />
<span style="color: #800080;">$name</span>.Location <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">140</span><span style="color: pink;">,</span> <span style="color: #804000;">50</span><span style="color: #000000;">&#41;</span> <br />
<span style="color: #800080;">$name</span>.AutoSize <span style="color: pink;">=</span> <span style="color: #800080;">$true</span> <br />
<span style="color: #800080;">$name</span>.Add_KeyUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>get<span style="color: pink;">-</span>email<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$form</span>.Controls.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$name</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.Label<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$emailLabel</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.Label<br />
<span style="color: #800080;">$emailLabel</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Email Address:&quot;</span><br />
<span style="color: #800080;">$emailLabel</span>.Width <span style="color: pink;">=</span> <span style="color: #804000;">110</span><br />
<span style="color: #800080;">$emailLabel</span>.Location <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">20</span><span style="color: pink;">,</span> <span style="color: #804000;">80</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$form</span>.Controls.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$emailLabel</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.TextBox<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$email</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.TextBox<br />
<span style="color: #800080;">$email</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">''</span><br />
<span style="color: #800080;">$email</span>.Location <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">140</span><span style="color: pink;">,</span> <span style="color: #804000;">80</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$email</span>.Width <span style="color: pink;">=</span> <span style="color: #804000;">200</span><br />
<span style="color: #800080;">$email</span>.AutoSize <span style="color: pink;">=</span> <span style="color: #800080;">$true</span> <br />
<span style="color: #800080;">$email</span>.Visible <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><br />
<span style="color: #800080;">$form</span>.Controls.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$email</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #000000;">&#91;</span>System.Windows.Forms.CheckBox<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$useOutlook</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Windows.Forms.CheckBox<br />
<span style="color: #800080;">$useOutlook</span>.Checked <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><br />
<span style="color: #800080;">$useOutlook</span>.Text <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Use Outlook&quot;</span><br />
<span style="color: #800080;">$useOutlook</span>.Location <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Drawing.Size<span style="color: #000000;">&#40;</span><span style="color: #804000;">20</span><span style="color: pink;">,</span> <span style="color: #804000;">20</span><span style="color: #000000;">&#41;</span> <br />
<span style="color: #800080;">$form</span>.Controls.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$useOutlook</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #800080;">$form</span>.Topmost <span style="color: pink;">=</span> <span style="color: #800080;">$True</span><br />
<span style="color: #800080;">$form</span>.Add_Shown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #800080;">$form</span>.Activate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$form</span>.ShowDialog<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>
<p>I hope you find these functions helpful. Please let me know if you run into any issues with them or know of a better way to do the same thing. Please keep in mind that scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=9g4oyjfg7lU:FemoUdqQSLM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=9g4oyjfg7lU:FemoUdqQSLM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=9g4oyjfg7lU:FemoUdqQSLM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=9g4oyjfg7lU:FemoUdqQSLM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=9g4oyjfg7lU:FemoUdqQSLM:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/9g4oyjfg7lU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2011/01/looking-up-email-addresses-with-powershell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2011/01/looking-up-email-addresses-with-powershell/</feedburner:origLink></item>
		<item>
		<title>Would You Like To Play A Game?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/IIKqySsOobo/</link>
		<comments>http://adventuresinsql.com/2010/12/would-you-like-to-play-a-game/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 15:26:34 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=714</guid>
		<description><![CDATA[Do you have a favorite line from a holiday movie? Can you change it around slightly to make it SQL related? If so then this is the game for you. Starting this morning and going until we get bored or run out of ideas we will be playing <a href="http://twitter.com/#!/search/%23tsqlHolidayMovieLines">#tsqlHolidayMovieLines</a> on Twitter. 
 <a href="http://adventuresinsql.com/2010/12/would-you-like-to-play-a-game/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Do you have a favorite line from a holiday movie? Can you change it around slightly to make it SQL related? If so then this is the game for you. Starting this morning and going until we get bored or run out of ideas we will be playing <a href="http://twitter.com/#!/search/%23tsqlHolidayMovieLines">#tsqlHolidayMovieLines</a> on Twitter. </p>
<p>The rules are simple, just tweet a quote from your favorite holiday movie including the <a href="http://twitter.com/#!/search/%23tsqlHolidayMovieLines">#tsqlHolidayMovieLines</a> hash tag. Holiday movies include any movie that is about the holidays, set in the holidays or even includes holiday decorations (yes, Die Hard is a holiday movie for our purposes).</p>
<p>If you want to play but are not yet on Twitter then go read <a href="http://i.brentozar.com/the-simple-twitter-book.pdf">Brent Ozar&#8217;s Simple Twitter Book</a> then go to <a href="http://twitter.com/">Twitter.com</a> and sign up for an account.</p>
<p>Lets hear your <a href="http://twitter.com/#!/search/%23tsqlHolidayMovieLines">#tsqlHolidayMovieLines</a>!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=IIKqySsOobo:rhWc_FvZKGI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=IIKqySsOobo:rhWc_FvZKGI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=IIKqySsOobo:rhWc_FvZKGI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=IIKqySsOobo:rhWc_FvZKGI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=IIKqySsOobo:rhWc_FvZKGI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/IIKqySsOobo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/12/would-you-like-to-play-a-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/12/would-you-like-to-play-a-game/</feedburner:origLink></item>
		<item>
		<title>Certificate Based Application Roles</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/2W6my0gaOpg/</link>
		<comments>http://adventuresinsql.com/2010/11/certificate-based-application-roles/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 01:53:52 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[User Management]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=705</guid>
		<description><![CDATA[What if I told you that you could sign an assembly that your Windows application uses with a certificate, load that certificate into SQL Server and then define rights on that user-assembly combination. The perfect world where a user would have different rights based on the application they are running but still act under their Windows identity. The perfect world where things work just the way they should.  <a href="http://adventuresinsql.com/2010/11/certificate-based-application-roles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>What if I told you that you could sign an assembly that your Windows application uses with a certificate, load that certificate into SQL Server and then define rights on that user-assembly combination? The perfect world where a user would have different rights based on the application they are running but still act under their Windows identity. The perfect world where things work just the way they should.</p>
<p>Sounds pretty awesome, huh?</p>
<p>The problem is that, as far as I know, this functionality does not exist yet. There might even be very good reasons why it does not exist yet, but this is a feature that I believe is overdue. Because of this, I have opened a Connect item to try to get Certificate Based Application Roles built into SQL Server. Here is the text of my <a href="https://connect.microsoft.com/SQLServer/feedback/details/625551/certificate-based-application-roles">Connect Item</a>:</p>
<blockquote><p>I am in search of a more perfect application role. What I would like is to be able to sign a Windows executeable or even an individual assembly with a certificate. I would then take that certificate and load it into SQL Server. I would then associate the certificate to Windows users and groups to form an application role. </p>
<p>The benefit of this approach is that depending on the executeable a user is running they could have different rights. A user that has reader on all tables in a database to query with Access might have execute on certain procedures when running the accounting application but have update on other tables when running the payroll software. </p>
<p>If the user changes departments then they would change rights via group membership. If they leave the company then all rights would be removed like any other windows login. All activity would take place under the context of the users login, simplifying auditing. </p></blockquote>
<p>If you are like me and think this functionality should exist then please go vote up my <a href="https://connect.microsoft.com/SQLServer/feedback/details/625551/certificate-based-application-roles">Connect Item</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=2W6my0gaOpg:NrXGtyNhQk8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=2W6my0gaOpg:NrXGtyNhQk8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=2W6my0gaOpg:NrXGtyNhQk8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=2W6my0gaOpg:NrXGtyNhQk8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=2W6my0gaOpg:NrXGtyNhQk8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/2W6my0gaOpg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/certificate-based-application-roles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/certificate-based-application-roles/</feedburner:origLink></item>
		<item>
		<title>Using DMVs to Find the Ports that SQL Server is Listening On</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/BhnRtug-VTw/</link>
		<comments>http://adventuresinsql.com/2010/11/using-dmvs-to-find-the-ports-that-sql-server-is-listening-on/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 03:00:33 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>
		<category><![CDATA[sys.dm_exec_connections]]></category>
		<category><![CDATA[sys.endpoints]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=700</guid>
		<description><![CDATA[The other day I was asked to provide the port number that a SQL Server instance was listening on. As luck would have it, the log file from the last time SQL Server started had rolled off so I was left with either using remote desktop to log onto the server and all the risk that includes or finally figuring out how to query it from the DMVs. I opted for the second option. <a href="http://adventuresinsql.com/2010/11/using-dmvs-to-find-the-ports-that-sql-server-is-listening-on/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day I was asked to provide the port number that a SQL Server instance was listening on. As luck would have it, the log file from the last time SQL Server started had rolled off so I was left with either using remote desktop to log onto the server and all the risk that includes or finally figuring out how to query it from the DMVs. I opted for the second option.</p>
<p>I did some digging, opening any of the system views that looked promising. Unfortunately, I was not having much luck. I was about to give up when I remembered that sys.dm_exec_connections will tell what IP address and port. If it had the endpoint_id to join to then I could create my own version of sys.endpoints with the information I need. A quick look at the view showed it had the fields I needed.</p>
<p>Here is the query I came up with:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">SELECT</span>&nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">name</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">endpoint_id</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">principal_id</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">protocol</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">protocol_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ec.<span style="color: #202020;">local_net_address</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ec.<span style="color: #202020;">local_tcp_port</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #808080;">&#91;</span>type<span style="color: #808080;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">type_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #808080;">&#91;</span><span style="color: #0000FF;">state</span><span style="color: #808080;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">state_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">is_admin_endpoint</span><br />
<span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; &nbsp; &nbsp; sys.<span style="color: #202020;">endpoints</span> e <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">LEFT</span> <span style="color: #808080;">OUTER</span> <span style="color: #808080;">JOIN</span> sys.<span style="color: #202020;">dm_exec_connections</span> ec<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ON</span> ec.<span style="color: #202020;">endpoint_id</span> <span style="color: #808080;">=</span> e.<span style="color: #202020;">endpoint_id</span><br />
<span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span>&nbsp; &nbsp; e.<span style="color: #202020;">name</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">endpoint_id</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">principal_id</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">protocol</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">protocol_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ec.<span style="color: #202020;">local_net_address</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ec.<span style="color: #202020;">local_tcp_port</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #808080;">&#91;</span>type<span style="color: #808080;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">type_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #808080;">&#91;</span><span style="color: #0000FF;">state</span><span style="color: #808080;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">state_desc</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">is_admin_endpoint</span></div></td></tr></tbody></table></div>
<p>I hope you find this script helpful. Please let me know if you run into any issues with it or know a better way to do the same thing. Please keep in mind that scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=BhnRtug-VTw:7sEyIPmJKCw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=BhnRtug-VTw:7sEyIPmJKCw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=BhnRtug-VTw:7sEyIPmJKCw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=BhnRtug-VTw:7sEyIPmJKCw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=BhnRtug-VTw:7sEyIPmJKCw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/BhnRtug-VTw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/using-dmvs-to-find-the-ports-that-sql-server-is-listening-on/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/using-dmvs-to-find-the-ports-that-sql-server-is-listening-on/</feedburner:origLink></item>
		<item>
		<title>How Do I Change SSRS Report Credentials with Powershell?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/Uy1g_TALvjc/</link>
		<comments>http://adventuresinsql.com/2010/11/how-do-i-change-ssrs-report-credentials-with-powershell/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 19:41:05 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=693</guid>
		<description><![CDATA[Ever had to change the login information for all reports in a particular folder? In my case I was going from SQL authentication to Windows authentication for 4 folders with 15-20 reports each. I had done this before, manually, but I broke a few reports and it took hours to complete. Having to do the whole thing a second time meant a script was in order.  <a href="http://adventuresinsql.com/2010/11/how-do-i-change-ssrs-report-credentials-with-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s script took a long time to write. The concepts are fairly simple and the resulting script is quite trivial but the lack of easy to find documentation on Reporting Services administration via scripts meant I got to spend a lot of time with my good friend intellisense. In fact, it actually led me to go out and download <a href="http://www.powergui.org/index.jspa">PowerGUI</a> and start using it again just to get intellisense.</p>
<p>Now that I am done whining about how difficult it was, let&#8217;s talk about the script. Ever had to change the login information for all reports in a particular folder? In my case I was going from SQL authentication to Windows authentication for 4 folders with 15-20 reports each. I had done this before, manually, but I broke a few reports and it took hours to complete. Having to do the whole thing a second time meant a script was in order. </p>
<p>The script below is pretty simple and could easily be turned into a function. It takes a target server, target folder, user name to change to and password to assign. I have the script hard-coded to use Windows Credentials because that is all I have tested with. With that information the script walks through the folder and adjusts the first data source on each report. If you have multiple data sources then you will want to add code to handle that. That is it. (I told you the result is deceptively simple.)</p>
<p>Here is the code:</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">CLS</span><br />
<br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$message</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$reportingServicesServer</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&lt;target_server&gt;&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$startingFolder</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&lt;target_folder&gt;&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$userName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&lt;user_id&gt;&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$password</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&lt;password&gt;&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$uri</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;http://{0}/ReportServer/ReportService2005.asmx?WSDL&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$reportingServicesServer</span><br />
<br />
<span style="color: #800080;">$reporting</span> <span style="color: pink;">=</span> New<span style="color: pink;">-</span>WebServiceProxy <span style="color: pink;">-</span>uri <span style="color: #800080;">$uri</span> <span style="color: pink;">-</span>UseDefaultCredential <span style="color: #008080; font-style: italic;">-namespace</span> <span style="color: #800000;">&quot;ReportingWebService&quot;</span><br />
<span style="color: #800080;">$reports</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reporting</span>.ListChildren<span style="color: #000000;">&#40;</span><span style="color: #800080;">$startingFolder</span><span style="color: pink;">,</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Where-Object</span> <span style="color: #000000;">&#123;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.<span style="color: #008080; font-weight: bold;">type</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;Report&quot;</span><span style="color: #000000;">&#125;</span> <br />
<br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$report</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$reports</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$message</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;{0}: Updating UserId and Password for the following report: '{1}'.&quot;</span> <span style="color: #FF0000;">-f</span> $<span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">get-date</span> <span style="color: #008080; font-style: italic;">-displayhint</span> DateTime<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #800080;">$report</span>.Path<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$message</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$dataSource</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reporting</span>.GetItemDataSources<span style="color: #000000;">&#40;</span><span style="color: #800080;">$report</span>.Path<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$dataSource</span>.Item.WindowsCredentials <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$dataSource</span>.Item.UserName <span style="color: pink;">=</span> <span style="color: #800080;">$userName</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$dataSource</span>.Item.Password <span style="color: pink;">=</span> <span style="color: #800080;">$password</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$reporting</span>.SetItemDataSources<span style="color: #000000;">&#40;</span><span style="color: #800080;">$report</span>.Path<span style="color: pink;">,</span> <span style="color: #800080;">$dataSource</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$message</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;{0}: Update completed.&quot;</span> <span style="color: #FF0000;">-f</span> $<span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">get-date</span> <span style="color: #008080; font-style: italic;">-displayhint</span> DateTime<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$message</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>So that&#8217;s it. I hope you find this script helpful. Please let me know if you run into any issues with it or know a better way to do the same thing. Please keep in mind that scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Uy1g_TALvjc:IwfsuwpF7kc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Uy1g_TALvjc:IwfsuwpF7kc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=Uy1g_TALvjc:IwfsuwpF7kc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=Uy1g_TALvjc:IwfsuwpF7kc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=Uy1g_TALvjc:IwfsuwpF7kc:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/Uy1g_TALvjc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/how-do-i-change-ssrs-report-credentials-with-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/how-do-i-change-ssrs-report-credentials-with-powershell/</feedburner:origLink></item>
		<item>
		<title>Careful with the New MCM Requirements</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/k7hdgfFA4Zs/</link>
		<comments>http://adventuresinsql.com/2010/11/careful-with-the-new-mcm-requirements/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 03:19:24 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MCM]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=681</guid>
		<description><![CDATA[Be careful with the new MCM requirements. You only need the SQL 2008 certifications now. If you have already started down the 2005 path then at least you know you are not alone. I should add that I have been in contact with the right people (not naming here since they may or may not be part of the first line support) to get the incorrect page updated. It may take a couple of weeks to get the incorrect page updated with the coming holiday but I am confident they will get it taken care of. <a href="http://adventuresinsql.com/2010/11/careful-with-the-new-mcm-requirements/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever since I first heard about the Microsoft Certified Master program I have been interested. The prestige of the certification and the promise of future riches are what draw many people in but for me the big selling point is the challenge. One of the big obstacles I had to pursuing the MCM was that I had not acquired any of the required certifications. A few weeks ago I decided to get out of my own way by removing the certification excuse. </p>
<p>My first step in getting certified was to figure out what certifications I needed. Since I knew I may someday want to take a shot at the MCM I looked up the required certifications on the MCM page. This is where I got into a bit of trouble. The page I went to listed the required certification as &#8220;MCITP: Database Administrator SQL Server&#8221; and &#8220;MCITP: Database Developer SQL Server&#8221;. As <a href="http://www.microsoft.com/learning/en/us/certification/cert-sql-server.aspx#tab3">this page</a> shows, the 2008 versions of the certifications include 2008 in their names. After some careful reading I decided I should sign up for the SQL 2005 tests.</p>
<p>Last week, while looking over the <a href="http://technet.microsoft.com/en-us/sqlserver/ff977043.aspx">MCM Readiness Videos<a>, I realized my mistake. On the front page there is a link to the <a href="http://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx">New Path to Microsoft Certified Master: Microsoft SQL Server 2008</a> and on that page the required certifications are clearly specified as the SQL 2008 versions. From the beginning I had planned to take the upgrade tests to cover the SQL 2008 certifications as well as the SQL 2005 certifications so I will end up where I need to be anyway and get some extra bullet points for my resume.</p>
<p>So there is my cautionary tale. Be careful with the new MCM requirements. You only need the SQL 2008 certifications now. If you have already started down the 2005 path then at least you know you are not alone. I should add that I have been in contact with the right people (not naming here since they may or may not be part of the first line support) to get the incorrect page updated. It may take a couple of weeks to get the incorrect page updated with the coming holiday but I am confident they will get it taken care of.</p>
<p>If you are thinking about the MCM, I say go for it. I can only see them making it more difficult to get once more people start to achieve it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=k7hdgfFA4Zs:sch0cMXYQac:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=k7hdgfFA4Zs:sch0cMXYQac:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=k7hdgfFA4Zs:sch0cMXYQac:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=k7hdgfFA4Zs:sch0cMXYQac:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=k7hdgfFA4Zs:sch0cMXYQac:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/k7hdgfFA4Zs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/careful-with-the-new-mcm-requirements/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/careful-with-the-new-mcm-requirements/</feedburner:origLink></item>
		<item>
		<title>Want to Make Your SQL Server Run Faster for Free?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/DAjluAkhCmo/</link>
		<comments>http://adventuresinsql.com/2010/11/want-to-make-your-sql-server-run-faster-for-free/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 03:24:04 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[File Management]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>
		<category><![CDATA[VLF]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=664</guid>
		<description><![CDATA[Want to Make Your SQL Server Run Faster for Free? The trick is to properly manage your VLFs. What are VLFs? The short anser is that VLF stands for virtual log file. SQL Server database log files are made up of many smaller virtual log files that make it easier for SQL Server to manage the log files.  <a href="http://adventuresinsql.com/2010/11/want-to-make-your-sql-server-run-faster-for-free/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know I do!</p>
<p>The trick is to properly manage your VLFs. </p>
<p>What are VLFs? The short anser is that VLF stands for virtual log file. SQL Server database log files are made up of many smaller virtual log files that make it easier for SQL Server to manage the log files. For a much more in-depth answer see the Transaction Log section Paul Randal&#8217;s (<a href="http://www.sqlskills.com/BLOGS/PAUL/">Blog</a>|<a href="http://twitter.com/PaulRandal">Twitter</a>) TechNet <a href="http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx#id0060041">article</a>.</p>
<p>The problem with virtual log files is that having too few or too many can slow your server down. I spoke to someone over the weekend that had to wait 30 hours for their database to complete recovery. When they checked they had 1.6 million virtual log files in their database. That is a lot by any standard. A more constant issue with having too many VLFs is that they can also slow down any log operation including logged statements like insert, update and delete. Check out this <a href="http://sqlblog.com/blogs/linchi_shea/archive/2009/02/09/performance-impact-a-large-number-of-virtual-log-files-part-i.aspx">article</a> by Linchi Shea (<a href="http://sqlblog.com/blogs/linchi_shea/default.aspx">Blog</a>) on the performance impact too many VLFs can have. Kimberly L. Tripp  (<a href="http://www.sqlskills.com/BLOGS/KIMBERLY/">Blog</a>|<a href="http://twitter.com/kimberlyltripp">Twitter</a>) has a great <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Transaction-Log-VLFs-too-many-or-too-few.aspx">article</a> on how many VLFs you should have.  </p>
<p>So if the trick to making your server run faster for free is to manage your VLFs, then how do you go about doing that? Great question. There are lots of great posts out there on how to do this. Here is an <a href="http://adventuresinsql.com/2009/12/a-busyaccidental-dbas-guide-to-managing-vlfs/">article</a> that I wrote detailing the process that I use and some of the reasoning behind it. </p>
<p>If you find any really high counts in your environment, we&#8217;ll say greater than 2 million VLFs, please leave a comment with how many. I am curious to see what the highest value is.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=DAjluAkhCmo:0v6K0ZMBhBM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=DAjluAkhCmo:0v6K0ZMBhBM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=DAjluAkhCmo:0v6K0ZMBhBM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=DAjluAkhCmo:0v6K0ZMBhBM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=DAjluAkhCmo:0v6K0ZMBhBM:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/DAjluAkhCmo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/want-to-make-your-sql-server-run-faster-for-free/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/want-to-make-your-sql-server-run-faster-for-free/</feedburner:origLink></item>
		<item>
		<title>Get Drive Space Including Mount Points</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/soIGsH4gaoo/</link>
		<comments>http://adventuresinsql.com/2010/11/get-drive-space-including-mount-points/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 20:27:16 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=655</guid>
		<description><![CDATA[Today's post is a quick one that came out of a conversation on Twitter. To make a long story short, somebody was having trouble with mount points filling up because they were not being caught by the current monitoring script. I offered to look up how my monitoring was figuring out this data and post it here.  <a href="http://adventuresinsql.com/2010/11/get-drive-space-including-mount-points/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s post is a quick one that came out of a conversation on Twitter. To make a long story short, somebody was having trouble with mount points filling up because they were not being caught by their current monitoring script. I offered to look up how my monitoring was doing this and post it here. </p>
<p>After some digging through various VBScript files I was able to confirm that I use a WMI query of Win32_Volume. The query I have is in a highly custom script that does not lend itself to being understandable if taken out of context so I went ahead and converted the logic to PowerShell, then messed with it a bit to come up with something human readable. Here is that script:</p>
<p><em>Update: Nicholas Cain (<a href="http://www.englishtosql.com/">Blog</a>|<a href="http://twitter.com/anonythemouse">Twitter</a>) suggested using 1GB to get results in gigabytes instead of using /1024/1024/1024. I was curious about this trick and after a little toying around, was able to adjust the script to allow the units of measure to be specified at the top. So go ahead and give it a try.</em></p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">cls</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$serverName</span> <span style="color: pink;">=</span> <span style="color: #800000;">'localhost'</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$unitOfMeasure</span> <span style="color: pink;">=</span> <span style="color: #800000;">'GB'</span> &nbsp;<span style="color: #008000;">#Use an empty string for bytes or KB, MB, GB, TB, PB etc.</span><br />
<br />
<span style="color: #800080;">$vols</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> <span style="color: #008080; font-style: italic;">-computername</span> <span style="color: #800080;">$serverName</span> <span style="color: #008080; font-style: italic;">-query</span> <span style="color: #800000;">&quot;select Name, DriveType, FileSystem, FreeSpace, Capacity, Label from Win32_Volume where DriveType = 2 or DriveType = 3&quot;</span><br />
<br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$vol</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$vols</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$driveType</span> <span style="color: pink;">=</span> <span style="color: #0000FF;">switch</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$vol</span>.DriveType<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">0</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'Unknown'</span><span style="color: #000000;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">1</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'No Root Directory'</span><span style="color: #000000;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">2</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'Removable Disk'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">3</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'Local Disk'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">4</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'Network Drive'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">5</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'Compact Disk'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #804000;">6</span> <span style="color: #000000;">&#123;</span><span style="color: #800000;">'RAM Disk'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; default <span style="color: #000000;">&#123;</span><span style="color: #800000;">'unknown'</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$drive</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Drive: {0}, {1}, {2}, {3}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$vol</span>.name<span style="color: pink;">,</span> <span style="color: #800080;">$driveType</span><span style="color: pink;">,</span> <span style="color: #800080;">$vol</span>.FileSystem<span style="color: pink;">,</span> <span style="color: #800080;">$vol</span>.Label<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$capacity</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Capacity: {0}{1}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #000000;">&#91;</span>System.Math<span style="color: #000000;">&#93;</span>::Round<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$vol</span>.capacity <span style="color: pink;">/</span> $<span style="color: #000000;">&#40;</span><span style="color: #800000;">'1'</span> <span style="color: pink;">+</span> <span style="color: #800080;">$unitOfMeasure</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #800080;">$unitOfMeasure</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$freeSpace</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Free Space: {0}{1}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #000000;">&#91;</span>System.Math<span style="color: #000000;">&#93;</span>::Round<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$vol</span>.FreeSpace <span style="color: pink;">/</span> $<span style="color: #000000;">&#40;</span><span style="color: #800000;">'1'</span> <span style="color: pink;">+</span> <span style="color: #800080;">$unitOfMeasure</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #800080;">$unitOfMeasure</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800080;">$drive</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800080;">$capacity</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800080;">$freeSpace</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>So there is the code as promised. The next logical step would be to add a call inside the loop to insert this information into a table for trending and alerting.</p>
<p>Please do not run this on an important machine before reviewing it thuroughly. I offer no warranty beyond a sympathetic ear if this script breaks something.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=soIGsH4gaoo:3lDx509i2qs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=soIGsH4gaoo:3lDx509i2qs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=soIGsH4gaoo:3lDx509i2qs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=soIGsH4gaoo:3lDx509i2qs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=soIGsH4gaoo:3lDx509i2qs:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/soIGsH4gaoo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/get-drive-space-including-mount-points/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/get-drive-space-including-mount-points/</feedburner:origLink></item>
		<item>
		<title>Troubleshooting SQL Server Error: 18456, Severity: 14, State: 16</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/vvLw-xyWuBc/</link>
		<comments>http://adventuresinsql.com/2010/11/troubleshooting-sql-server-error-18456-severity-14-state-16/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 18:17:47 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Login failure]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=642</guid>
		<description><![CDATA[I recently struggled with tracking down a rogue process that was failing to log in on one of my servers. It took a bit of fiddling but I eventually found that you can trace login failed due to missing database errors with Profiler. The trick is to look for the User Error Message filtered for TextData Like 'Cannot open database%'. <a href="http://adventuresinsql.com/2010/11/troubleshooting-sql-server-error-18456-severity-14-state-16/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had to track down a rogue process that was failing to log in on one of my servers. It took a bit of fiddling, but eventually I found that you can trace login failed due to missing database errors with Profiler. The trick is to look for User Error Messages where TextData Like &#8216;Cannot open database%&#8217;.</p>
<p>Here are the steps if you want to try this yourself:</p>
<p>1. Open <strong>Profiler</strong><br />
2. Specify a server name<br />
3. Use the <strong>Blank</strong> template<br />
4. Place a check in the box next to <strong>User Error Message</strong> in the <strong>Errors and Warnings</strong> group<br />
5. Scroll right and click the column header for <strong>TextData</strong><br />
6. Expand <strong>Like</strong> and type <strong>Cannot open database%</strong><br />
7. Click <strong>Run</strong></p>
<p>Once you have the trace up and running you just have to wait for the process to try to log in again and you will have plenty of information to go do some finger pointing. If you are like me and like to test your traces to make sure they are working or just want to try this out before you need it in real life, here is a PowerShell script to simulate the failures:</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">cls</span><br />
<br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$serverName</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$databaseName</span><br />
<br />
<span style="color: #800080;">$serverName</span> <span style="color: pink;">=</span> <span style="color: #800000;">'&lt;server_name&gt;'</span> <span style="color: #008000;">#Make sure to enter your server name here</span><br />
<span style="color: #800080;">$databaseName</span> <span style="color: pink;">=</span> <span style="color: #800000;">'MissingDB'</span><br />
<br />
<span style="color: #800080;">$SqlConnection</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Data.SqlClient.SqlConnection<br />
<br />
<span style="color: #800080;">$SqlConnection</span>.ConnectionString <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Server=$serverName;Database=$databaseName;Integrated Security=True;Network Library=dbmssocn;&quot;</span><br />
<span style="color: #800080;">$SqlConnection</span>.StatisticsEnabled <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><br />
<span style="color: #800080;">$SqlConnection</span>.open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$SqlConnection</span> <br />
<br />
<span style="color: #800080;">$SqlConnection</span>.close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
$SqlConnection</div></td></tr></tbody></table></div>
<p>I hope you find this information useful. Please make sure you are comfortable with the process described above before trying it anywhere important. The steps above have worked well for me but your results may vary. I offer no warranty beyond a sympathetic ear should you run into trouble.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=vvLw-xyWuBc:BcATjxWV7U8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=vvLw-xyWuBc:BcATjxWV7U8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=vvLw-xyWuBc:BcATjxWV7U8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=vvLw-xyWuBc:BcATjxWV7U8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=vvLw-xyWuBc:BcATjxWV7U8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/vvLw-xyWuBc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/troubleshooting-sql-server-error-18456-severity-14-state-16/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/troubleshooting-sql-server-error-18456-severity-14-state-16/</feedburner:origLink></item>
		<item>
		<title>A Brute Force Way to Compress a Database</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/AOK4rVtXsMw/</link>
		<comments>http://adventuresinsql.com/2010/11/a-brute-force-way-to-compress-a-database/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 00:26:15 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Compression]]></category>
		<category><![CDATA[DATA_COMPRESSION]]></category>
		<category><![CDATA[PAGE]]></category>
		<category><![CDATA[ROW]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=632</guid>
		<description><![CDATA[There are a handful of scripts out there to compress all of of the objects in your SQL 2008 database using Row, Page or a smart combination of both compression types. This is not one of those scripts. 
 <a href="http://adventuresinsql.com/2010/11/a-brute-force-way-to-compress-a-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a handful of scripts out there to compress all of of the objects in your SQL 2008 database using Row, Page or a smart combination of both compression types. This is not one of those scripts. </p>
<p>This script is written to compress all tables in a database without wasting any time on analysis. I have implemented the script as a stored procedure that takes 2 paramaters. The first is whether to use row or page compression and the second is how long to run for in minutes. The intent would be to call the stored procedure from a job on a regular basis to run for x minutes compressing everything it can then shut down and wait for the next run time and do the same. Eventually all objects in the database will be compressed.</p>
<p>I would recommend against running this without any analysis against any database. That said, it can be a handy tool for compressing an ODS or even an EDW. It would also be a great way to pick up &#8220;the rest of the tables&#8221; in a database where proper analysis has been done and a particular compression type has been applied to a small set of tables.</p>
<p>Here is the script:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">sp_dba_compress_user_objects</span> @compression_type <span style="color: #0000FF;">nvarchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">20</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'PAGE'</span>, @minutes_to_run <span style="color: #0000FF;">int</span> <span style="color: #808080;">=</span> <span style="color: #000;">1440</span><br />
<br />
<span style="color: #0000FF;">AS</span><br />
<br />
<span style="color: #0000FF;">DECLARE</span> @schema_name&nbsp; &nbsp; &nbsp; &nbsp; sysname,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @<span style="color: #FF00FF;">object_name</span>&nbsp; &nbsp; &nbsp; &nbsp; sysname,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @sql_string &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">nvarchar</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">max</span><span style="color: #808080;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @row_count&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">int</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @start_time &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">datetime</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @index_type_desc &nbsp; &nbsp;<span style="color: #0000FF;">nvarchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">60</span><span style="color: #808080;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #0000FF;">SELECT</span>&nbsp; @row_count &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">=</span> <span style="color: #000;">1</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @start_time &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">=</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; @compression_type &nbsp; <span style="color: #808080;">=</span> <span style="color: #FF00FF;">UPPER</span><span style="color: #808080;">&#40;</span>@compression_type<span style="color: #808080;">&#41;</span><br />
<br />
<span style="color: #0000FF;">IF</span> @compression_type <span style="color: #808080;">NOT</span> <span style="color: #808080;">IN</span> <span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'ROW'</span>, <span style="color: #FF0000;">'PAGE'</span><span style="color: #808080;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">RAISERROR</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'@compression_type must be '</span><span style="color: #FF0000;">'ROW'</span><span style="color: #FF0000;">' or '</span><span style="color: #FF0000;">'PAGE'</span><span style="color: #FF0000;">''</span>, <span style="color: #000;">16</span>, <span style="color: #000;">1</span><span style="color: #808080;">&#41;</span><br />
<br />
<span style="color: #0000FF;">WHILE</span> @row_count <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span> <span style="color: #808080;">AND</span> <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>mi, @minutes_to_run, @start_time<span style="color: #808080;">&#41;</span> <span style="color: #808080;">&gt;</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><br />
&nbsp;<span style="color: #0000FF;">BEGIN</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">TOP</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @schema_name <span style="color: #808080;">=</span> OBJECT_SCHEMA_NAME<span style="color: #808080;">&#40;</span>p.<span style="color: #FF00FF;">object_id</span>, <span style="color: #FF00FF;">DB_ID</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @<span style="color: #FF00FF;">object_name</span> <span style="color: #808080;">=</span> <span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#40;</span>p.<span style="color: #FF00FF;">object_id</span>, <span style="color: #FF00FF;">DB_ID</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @index_type_desc <span style="color: #808080;">=</span> ips.<span style="color: #202020;">index_type_desc</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; &nbsp; &nbsp; sys.<span style="color: #202020;">partitions</span> p<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> sys.<span style="color: #202020;">dm_db_index_physical_stats</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">DB_ID</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>, <span style="color: #808080;">NULL</span>, <span style="color: #808080;">NULL</span>, <span style="color: #808080;">NULL</span>, <span style="color: #FF0000;">'LIMITED'</span><span style="color: #808080;">&#41;</span> ips<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ON</span> p.<span style="color: #FF00FF;">object_id</span> <span style="color: #808080;">=</span> ips.<span style="color: #FF00FF;">object_id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> p.<span style="color: #202020;">index_id</span> <span style="color: #808080;">=</span> ips.<span style="color: #202020;">index_id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">LEFT</span> <span style="color: #808080;">OUTER</span> <span style="color: #808080;">JOIN</span> sys.<span style="color: #202020;">columns</span> c<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ON</span> p.<span style="color: #FF00FF;">object_id</span> <span style="color: #808080;">=</span> c.<span style="color: #FF00FF;">object_id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> c.<span style="color: #202020;">is_sparse</span> <span style="color: #808080;">=</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">WHERE</span> &nbsp; &nbsp; &nbsp; p.<span style="color: #202020;">data_compression_desc</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'NONE'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> <span style="color: #FF00FF;">OBJECTPROPERTY</span><span style="color: #808080;">&#40;</span>p.<span style="color: #FF00FF;">object_id</span>, <span style="color: #FF0000;">'IsUserTable'</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> <span style="color: #FF00FF;">OBJECTPROPERTY</span><span style="color: #808080;">&#40;</span>c.<span style="color: #FF00FF;">object_id</span>, <span style="color: #FF0000;">'IsMSShipped'</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> c.<span style="color: #FF00FF;">object_id</span> <span style="color: #0000FF;">IS</span> <span style="color: #808080;">NULL</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">ORDER</span> <span style="color: #0000FF;">BY</span>&nbsp; &nbsp; ips.<span style="color: #202020;">page_count</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; @row_count <span style="color: #808080;">=</span> <span style="color: #FF00FF;">@@ROWCOUNT</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000FF;">IF</span> @row_count <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">BEGIN</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">IF</span> @index_type_desc <span style="color: #808080;">=</span> <span style="color: #FF0000;">'HEAP'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">BEGIN</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; @sql_string <span style="color: #808080;">=</span> <span style="color: #FF0000;">'ALTER TABLE '</span> <span style="color: #808080;">+</span> <span style="color: #FF00FF;">QUOTENAME</span><span style="color: #808080;">&#40;</span>@schema_name<span style="color: #808080;">&#41;</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">'.'</span> <span style="color: #808080;">+</span> <span style="color: #FF00FF;">QUOTENAME</span><span style="color: #808080;">&#40;</span>@<span style="color: #FF00FF;">object_name</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">' REBUILD PARTITION=ALL WITH (DATA_COMPRESSION='</span> <span style="color: #808080;">+</span> @compression_type <span style="color: #808080;">+</span> <span style="color: #FF0000;">', ONLINE=ON)'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">RAISERROR</span><span style="color: #808080;">&#40;</span>@sql_string, <span style="color: #000;">0</span>, <span style="color: #000;">0</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">WITH</span> NOWAIT<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">EXEC</span>&nbsp; &nbsp; <span style="color: #AF0000;">sp_executesql</span> @sql_string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">END</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; @sql_string <span style="color: #808080;">=</span> <span style="color: #FF0000;">'ALTER INDEX ALL ON '</span> <span style="color: #808080;">+</span> <span style="color: #FF00FF;">QUOTENAME</span><span style="color: #808080;">&#40;</span>@schema_name<span style="color: #808080;">&#41;</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">'.'</span> <span style="color: #808080;">+</span> <span style="color: #FF00FF;">QUOTENAME</span><span style="color: #808080;">&#40;</span>@<span style="color: #FF00FF;">object_name</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">' REBUILD PARTITION=ALL WITH (DATA_COMPRESSION='</span> <span style="color: #808080;">+</span> @compression_type <span style="color: #808080;">+</span> <span style="color: #FF0000;">', ONLINE=ON)'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">RAISERROR</span><span style="color: #808080;">&#40;</span>@sql_string, <span style="color: #000;">0</span>, <span style="color: #000;">0</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">WITH</span> NOWAIT<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">EXEC</span>&nbsp; &nbsp; <span style="color: #AF0000;">sp_executesql</span> @sql_string<br />
&nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">END</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">ELSE</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">BEGIN</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'No work to do.'</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">END</span><br />
&nbsp;<span style="color: #0000FF;">END</span><br />
&nbsp;<br />
&nbsp;<span style="color: #0000FF;">IF</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&gt;</span> <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>mi, @minutes_to_run, @start_time<span style="color: #808080;">&#41;</span><br />
&nbsp; <span style="color: #0000FF;">BEGIN</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'Shut down to due long run time.'</span><br />
&nbsp; <span style="color: #0000FF;">END</span><br />
GO</div></td></tr></tbody></table></div>
<p>I hope you find this stored procedure useful, but I realize it is not for everyone.  As always scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=AOK4rVtXsMw:zPZ4A2evpyM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=AOK4rVtXsMw:zPZ4A2evpyM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=AOK4rVtXsMw:zPZ4A2evpyM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=AOK4rVtXsMw:zPZ4A2evpyM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=AOK4rVtXsMw:zPZ4A2evpyM:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/AOK4rVtXsMw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/11/a-brute-force-way-to-compress-a-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/11/a-brute-force-way-to-compress-a-database/</feedburner:origLink></item>
		<item>
		<title>When is that Restore Going to Finish?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/43eDgbMYCdk/</link>
		<comments>http://adventuresinsql.com/2010/10/when-is-that-restore-going-to-finish/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 19:21:59 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dm_exec_requests]]></category>
		<category><![CDATA[estimated_completion_time]]></category>
		<category><![CDATA[percent_complete]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[SQL 2008 R2]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=617</guid>
		<description><![CDATA[This post describes a query to get the estimated completion time of a process on SQL Server. <a href="http://adventuresinsql.com/2010/10/when-is-that-restore-going-to-finish/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spent a good portion of last weekend restoring databases from backup due to a large release. Nothing went wrong, luckily, but I was practicing in case something did. It goes without saying that I spent a ton of that time sitting in front of my PC wondering when the restores would finally finish. In my boredom I started looking at ways to use the percent_complete column in sys.dm_exec_requests. As I was working on my query I noticed a column named estimated_completion_time. I had never seen this column before, but since the server I was on was running SQL 2005 I can only guess it had been there for some time.</p>
<p>After doing a quick search on the internet for how to use the column I ended up in Books Online. The definition for the column published there is &#8220;Internal only. Is not nullable.&#8221; Now that I knew someone did not want me to use the field I really wanted to use it. The field contained a really big number so I started looking at how to translate it into a time. Given that it was a really big number and seemed to be counting down, I tried adding it as milliseconds to the current date. I was a little shocked when the query returned a time a few minutes into the future that ended up pretty close to right on the first try.</p>
<p>Here is the query that I came up with:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">SELECT</span>&nbsp; command,<br />
&nbsp; &nbsp; &nbsp; &nbsp; session_id,<br />
&nbsp; &nbsp; &nbsp; &nbsp; percent_complete,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>ms, estimated_completion_time, <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> estimated_completion_time,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; start_time<br />
<span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; master.<span style="color: #202020;">sys</span>.<span style="color: #202020;">dm_exec_requests</span><br />
<span style="color: #0000FF;">WHERE</span> &nbsp; percent_complete <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span></div></td></tr></tbody></table></div>
<p>As I ran the query throughout the weekend I noticed that it was not always 100% accurate. A big thing I noticed is when restoring a SQL 2005 database to a SQL 2008 server the percent complete will be at or near 100% and the estimated completion time will be the current time while the conversion from SQL 2005 to SQL 2008 happens. That said, I still find this query very useful for giving a ballpark end time to a multi-hour restore and also found it very helpful for gauging the impact of changes like shutting off other jobs on the server or asking people to postpone work that adds x hours to the process.</p>
<p>I hope you find this query useful. I expect that it will work for any process that reports progress so the applications are definitely not limited just to restores. As always scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<p><em>UPDATE: Aaron Bertrand has a version of this query that shows more information available here: <a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/30/when-will-my-backup-restore-index-reorganize-finish.aspx">http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/30/when-will-my-backup-restore-index-reorganize-finish.aspx</a></em></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=43eDgbMYCdk:x5BmNs_mFAQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=43eDgbMYCdk:x5BmNs_mFAQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=43eDgbMYCdk:x5BmNs_mFAQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=43eDgbMYCdk:x5BmNs_mFAQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=43eDgbMYCdk:x5BmNs_mFAQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/43eDgbMYCdk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/10/when-is-that-restore-going-to-finish/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/10/when-is-that-restore-going-to-finish/</feedburner:origLink></item>
		<item>
		<title>Stop Forgetting the DAC</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/oOQELCVLRbE/</link>
		<comments>http://adventuresinsql.com/2010/10/stop-forgetting-the-dac/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 17:09:25 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[DAC]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=610</guid>
		<description><![CDATA[We no longer have to blindly restart SQL, hoping that we are not setting up a situation where our most important database will be in recovery for minutes or hours. We now have the tools to accurately diagnose a problem the first time it happens. We just have to remember to use them. <a href="http://adventuresinsql.com/2010/10/stop-forgetting-the-dac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>From time to time I hear of DBAs that had to restart the SQL Server service on a 2005 or 2008 server because it had stopped accepting new connections. The thing is that most times those servers did not have to be restarted. If the DBA had logged in via the Dedicated Administrator Connection (DAC) they would have been able to identify and either kill or track the progress of the offending query.</p>
<p>So what is the DAC? It is a special reserved connection that allows 1 connection from the local machine by appending &#8220;ADMIN:&#8221; to the beginning of the server or server\instance name. (Exact instructions are available <a href="http://msdn.microsoft.com/en-us/library/ms178068(SQL.90).aspx">here</a>) The DAC is by default only available to clients connection from the machine that the instance is running on. There is a setting that allows people to connect over the network but in an emergency it is good to know who is using that connection. Forcing people to log onto the box to use the connection means you can see who might have the connection by looking at who is connected to the server. Remember you can&#8217;t connect to SQL Server to see who is connected if things are bad enough that the DAC is your only option.</p>
<p>The great part about the Dedicated Administrator Connection (DAC) is that it is always available for someone to connect. Even when normal connections to the server do not work the DAC is ready to accept a connection. Once connected via SSMS (Query Window not Object Explorer) or SQLCMD a DBA can quickly diagnose and resolve an issue. </p>
<p>We no longer have to blindly restart SQL, hoping that we are not setting up a situation where our most important database will be in recovery for minutes or hours. </p>
<p>We now have the tools to accurately diagnose a problem the first time it happens.</p>
<p>We just have to remember to use them.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=oOQELCVLRbE:9XkPyAGYt0w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=oOQELCVLRbE:9XkPyAGYt0w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=oOQELCVLRbE:9XkPyAGYt0w:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=oOQELCVLRbE:9XkPyAGYt0w:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=oOQELCVLRbE:9XkPyAGYt0w:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/oOQELCVLRbE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/10/stop-forgetting-the-dac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/10/stop-forgetting-the-dac/</feedburner:origLink></item>
		<item>
		<title>How Do I Spot Identity Columns That Are About to Max Out?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/5KP4zl4KyBY/</link>
		<comments>http://adventuresinsql.com/2010/10/how-do-i-spot-identity-columns-that-are-about-to-max-out/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 14:00:39 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[SQL 2008 R2]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=596</guid>
		<description><![CDATA[Every so often, usually in the middle of the night or on a holiday weekend, an identity column will hit the maximum size for it's data type and stop allowing new values to be inserted into the table. I needed a way to identify the identity columns that are in danger of maxing out before they did, so I wrote one. <a href="http://adventuresinsql.com/2010/10/how-do-i-spot-identity-columns-that-are-about-to-max-out/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every so often, usually in the middle of the night or on a holiday weekend, an identity column will hit the maximum size for it&#8217;s data type and stop allowing new values to be inserted into the table. It goes without saying that an identity column with enough activity to hit the maximum value of even a regular integer indicates a busy table. Oddly enough, none of the monitoring tools that I have looks for an identity column that is about to fill up.</p>
<p>Since I had identified a real problem I decided it was time to turn to my problem solver, SQL Server Management Studio. I was able to quickly throw together a stored procedure that I can install on each of my machines then add custom alerts to my monitoring tools to call it. Since some tools run at the server level and others at the database level I wrote the script to work at the database level. For simplicity I have included a script at the bottom to run this stored procedure on all databases on a server.</p>
<p>The stored procedure logic is to get all identity columns in a database, using the column type from sys.types to calculate percent full based on current identity value vs. maximum identity value for that type. The inner query then returns those values back to the outer query to be filtered and have severity assigned. I could have written the whole thing as a single select rather than nesting it but writing it this way made it so much more readable. </p>
<p>Here is the code for the stored procedure:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">sp_dba_check_identities_for_space</span> @warning_threshold_in_pct <span style="color: #0000FF;">int</span> <span style="color: #808080;">=</span> <span style="color: #000;">80</span>, @error_threshold_in_pct <span style="color: #0000FF;">int</span> <span style="color: #808080;">=</span> <span style="color: #000;">90</span><br />
<span style="color: #0000FF;">AS</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; @warning_threshold_in_pct <span style="color: #808080;">=</span> @error_threshold_in_pct <br />
&nbsp; &nbsp; <span style="color: #0000FF;">WHERE</span> &nbsp; @warning_threshold_in_pct <span style="color: #808080;">&gt;</span> @error_threshold_in_pct<br />
<br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; database_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; column_type,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; percent_used,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">CASE</span> <span style="color: #0000FF;">WHEN</span> percent_used <span style="color: #808080;">&gt;=</span> @error_threshold_in_pct <span style="color: #0000FF;">THEN</span> <span style="color: #FF0000;">'ERROR'</span> <span style="color: #0000FF;">ELSE</span> <span style="color: #FF0000;">'WARNING'</span> <span style="color: #0000FF;">END</span> <span style="color: #0000FF;">AS</span> severity <br />
&nbsp; &nbsp; <span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; <span style="color: #808080;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; <span style="color: #FF00FF;">DB_NAME</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">as</span> database_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#40;</span>c.<span style="color: #FF00FF;">object_id</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">as</span> table_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF00FF;">IDENT_CURRENT</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#40;</span>c.<span style="color: #FF00FF;">object_id</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">as</span> index_seed,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #0000FF;">as</span> column_type,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">IDENT_CURRENT</span><span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#40;</span>c.<span style="color: #FF00FF;">object_id</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">CASE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'bigint'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">9223372036854775807.00</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'int'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">2147483647.00</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'smallint'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">32767.00</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'tinyint'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">255.00</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'numeric'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #FF00FF;">POWER</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span>, c.<span style="color: #0000FF;">precision</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">-</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'decimal'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #FF00FF;">POWER</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span>, c.<span style="color: #0000FF;">precision</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">-</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'money'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">922337203685477.5807</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHEN</span>&nbsp; &nbsp; t.<span style="color: #202020;">name</span> <span style="color: #808080;">=</span> <span style="color: #FF0000;">'smallmoney'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">THEN</span>&nbsp; &nbsp; <span style="color: #000;">214748.3647</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ELSE</span>&nbsp; &nbsp; <span style="color: #000;">1.00</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">END</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">*</span> <span style="color: #000;">100</span> <span style="color: #0000FF;">AS</span> percent_used<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; sys.<span style="color: #202020;">columns</span> c<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> sys.<span style="color: #202020;">types</span> t<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ON</span> c.<span style="color: #202020;">system_type_id</span> <span style="color: #808080;">=</span> t.<span style="color: #202020;">system_type_id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHERE</span> &nbsp; c.<span style="color: #202020;">is_identity</span> <span style="color: #808080;">=</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">AND</span> <span style="color: #FF00FF;">OBJECTPROPERTY</span><span style="color: #808080;">&#40;</span>c.<span style="color: #FF00FF;">object_id</span>, <span style="color: #FF0000;">'IsUserTable'</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> <span style="color: #000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080;">&#41;</span> dt <br />
&nbsp; &nbsp; <span style="color: #0000FF;">WHERE</span> &nbsp; percent_used <span style="color: #808080;">&gt;</span> @warning_threshold_in_pct<br />
GO<br />
<br />
<span style="color: #0000FF;">EXEC</span> sys.<span style="color: #202020;">sp_MS_marksystemobject</span> <span style="color: #FF0000;">'sp_dba_check_identities_for_space'</span></div></td></tr></tbody></table></div>
<p>Here is a script to run the stored procedure for all databases on a server:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> #sp_dba_check_identities_for_space_results<br />
<span style="color: #808080;">&#40;</span><br />
&nbsp; &nbsp; database_name &nbsp; sysname,<br />
&nbsp; &nbsp; table_name&nbsp; &nbsp; &nbsp; sysname,<br />
&nbsp; &nbsp; column_type &nbsp; &nbsp; sysname,<br />
&nbsp; &nbsp; percent_used&nbsp; &nbsp; <span style="color: #0000FF;">int</span>,<br />
&nbsp; &nbsp; severity&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">20</span><span style="color: #808080;">&#41;</span><br />
<span style="color: #808080;">&#41;</span><br />
<br />
<span style="color: #0000FF;">EXEC</span> sp_MSforeachdb <span style="color: #FF0000;">'USE ?<br />
INSERT #sp_dba_check_identities_for_space_results<br />
&nbsp; &nbsp; EXEC dbo.sp_dba_check_identities_for_space'</span><br />
&nbsp; &nbsp; <br />
<span style="color: #0000FF;">SELECT</span>&nbsp; database_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; table_name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; column_type,<br />
&nbsp; &nbsp; &nbsp; &nbsp; percent_used,<br />
&nbsp; &nbsp; &nbsp; &nbsp; severity<br />
<span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; #sp_dba_check_identities_for_space_results<br />
<br />
<span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">TABLE</span> #sp_dba_check_identities_for_space_results</div></td></tr></tbody></table></div>
<p>Please let me know if you run into any issues, have any ideas that would make this stored procedure better or just want to share how you are using it. As always scripts from the internet are like Halloween candy, inspect before consumption. I offer no warranty beyond a sympathetic ear if you should run into any issues.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=5KP4zl4KyBY:6ASxEABZTsI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=5KP4zl4KyBY:6ASxEABZTsI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=5KP4zl4KyBY:6ASxEABZTsI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=5KP4zl4KyBY:6ASxEABZTsI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=5KP4zl4KyBY:6ASxEABZTsI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/5KP4zl4KyBY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/10/how-do-i-spot-identity-columns-that-are-about-to-max-out/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/10/how-do-i-spot-identity-columns-that-are-about-to-max-out/</feedburner:origLink></item>
		<item>
		<title>Can Deadlocks be Resolved by Adding an Index?</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/bnEOMw8XZpg/</link>
		<comments>http://adventuresinsql.com/2010/09/can-deadlocks-be-resolved-by-adding-an-index/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 14:00:57 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[DBCC PAGE]]></category>
		<category><![CDATA[Deadlock]]></category>
		<category><![CDATA[DELETE]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[SSP]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=529</guid>
		<description><![CDATA[Can Deadlocks be Resolved by Adding an Index? Yes. Really, I'm not kidding. Here, I'll show you how. <a href="http://adventuresinsql.com/2010/09/can-deadlocks-be-resolved-by-adding-an-index/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Can Deadlocks be Resolved by Adding an Index? Yes. Really, I&#8217;m not kidding. Here, I&#8217;ll show you how.</p>
<p>First, let me set the scene: One of the applications I support has had issues with deadlocks for some time now. The deadlocks are really a result of design issues that it would be too expensive to fix. One of the challenges of the current design is that some of the data is partitioned the old fashioned way, in multiple tables, based on request type. The challenge of this design is it means there are two tables that have a sequential integer that is shared between them. The idea is to be able to query both tables, union the result sets together in sequence as though they had been in the same table. To accomplish this task a third table was added to track the sequence number as an identity column. A stored procedure inserts a record into the table, grabs the identity value and then deletes the inserted row. The deadlocks have been happening in the stored procedure that grabs that identity value. </p>
<p>Digging into the issue, my first step was to reproduce the deadlock to make sure I had a grasp of what was going on. I will include the code here in case anyone wants to follow along at home.</p>
<p>Step 1 is to create a table:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">IF</span> <span style="color: #808080;">EXISTS</span><span style="color: #808080;">&#40;</span>&nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; <span style="color: #808080;">*</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">FROM</span>&nbsp; &nbsp; sys.<span style="color: #202020;">tables</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">WHERE</span> &nbsp; name <span style="color: #808080;">=</span> <span style="color: #FF0000;">'FriendlyNumberSeed'</span> <span style="color: #808080;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">FriendlyNumberSeed</span><br />
GO<br />
<br />
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">FriendlyNumberSeed</span><br />
<span style="color: #808080;">&#40;</span><br />
&nbsp; &nbsp; LastCaseNumber <span style="color: #0000FF;">int</span> <span style="color: #0000FF;">IDENTITY</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span>,<span style="color: #000;">1</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">NOT</span> <span style="color: #808080;">NULL</span>,<br />
&nbsp; &nbsp; DateRetrieved <span style="color: #0000FF;">datetime</span> <span style="color: #808080;">NOT</span> <span style="color: #808080;">NULL</span><br />
<span style="color: #808080;">&#41;</span><br />
GO</div></td></tr></tbody></table></div>
<p>Step 2 is to insert some data and create some locks. Run this code in the same window:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">BEGIN</span> <span style="color: #0000FF;">TRANSACTION</span><br />
<br />
<span style="color: #0000FF;">INSERT</span> dbo.<span style="color: #202020;">FriendlyNumberSeed</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> DateRetrieved</div></td></tr></tbody></table></div>
<p>Step 3 is to create more data and more blocking. Run this code in a separate window:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">BEGIN</span> <span style="color: #0000FF;">TRANSACTION</span><br />
<br />
<span style="color: #0000FF;">INSERT</span> dbo.<span style="color: #202020;">FriendlyNumberSeed</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">SELECT</span>&nbsp; <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> DateRetrieved</div></td></tr></tbody></table></div>
<p>Step 4 is to create some blocking. Run this in the first window:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">DELETE</span>&nbsp; dbo.<span style="color: #202020;">FriendlyNumberSeed</span> <br />
<span style="color: #0000FF;">WHERE</span> &nbsp; LastCaseNumber <span style="color: #808080;">=</span> <span style="color: #FF00FF;">SCOPE_IDENTITY</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span></div></td></tr></tbody></table></div>
<p>Step 5 is to create the deadlock. Run this code in the second window:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">DELETE</span>&nbsp; dbo.<span style="color: #202020;">FriendlyNumberSeed</span> <br />
<span style="color: #0000FF;">WHERE</span> &nbsp; LastCaseNumber <span style="color: #808080;">=</span> <span style="color: #FF00FF;">SCOPE_IDENTITY</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span></div></td></tr></tbody></table></div>
<p>During my testing I had a few seconds between setting up the deadlock and the deadlock monitor reacting to it so I was able to pull the &#8220;All Transactions&#8221; report by right clicking on the database in Management Studio and selecting Reports > Standard Reports > All Transactions. </p>
<p>Here are the results I saw:</p>
<div id="attachment_536" class="wp-caption aligncenter" style="width: 769px"><a href="http://adventuresinsql.com/wp-content/uploads/2010/09/BeforeIndex.jpg"><img src="http://adventuresinsql.com/wp-content/uploads/2010/09/BeforeIndex.jpg" alt="Locks before adding an index" title="Locks Before" width="759" height="632" class="size-full wp-image-536" /></a><p class="wp-caption-text">Locks before adding an index</p></div>
<p>I spent a while digging into this, even breaking out DBCC PAGE to look at the page structure to try to figure out what was happening. After working through several wild theories, I looked at the locks again. That&#8217;s when it hit me: Why would the first transaction try to grab an update lock on the row inserted by the second transaction? There are no indexes on the table. </p>
<p>To delete a record from a table with no indexes SQL Server has to do a table scan, meaning it has to touch every single row to see if they qualify. To avoid deadlocks SQL Server grabs an update lock before reading the record. In this case the update lock is prevented by the exclusive lock still held by the insert. To see if I was on the right track I looked at the plan for the delete.</p>
<p>Here it is:</p>
<div id="attachment_538" class="wp-caption aligncenter" style="width: 887px"><a href="http://adventuresinsql.com/wp-content/uploads/2010/09/DeleteWithScan.jpg"><img src="http://adventuresinsql.com/wp-content/uploads/2010/09/DeleteWithScan.jpg" alt="A query plan for a delete that does a table scan" title="Delete with Table Scan Query Plan" width="877" height="132" class="size-full wp-image-538" /></a><p class="wp-caption-text">Query plan showing table scan while performing a delete</p></div>
<p>At this point I am pretty sure I am on the right track so it is time for more testing. The next thing I did was to put ROLLBACK WORK commands in both of my query windows to make sure that both transactions were completely out of the way. I then ran the following code:</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">CLUSTERED</span> <span style="color: #0000FF;">INDEX</span> IX_FriendlyNumberSeed_LastCaseNumber<br />
<span style="color: #0000FF;">ON</span> dbo.<span style="color: #202020;">FriendlyNumberSeed</span> <span style="color: #808080;">&#40;</span>LastCaseNumber<span style="color: #808080;">&#41;</span><br />
<span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">FILLFACTOR</span><span style="color: #808080;">=</span><span style="color: #000;">100</span><span style="color: #808080;">&#41;</span><br />
GO</div></td></tr></tbody></table></div>
<p>With the index in place I re-ran steps 2-5 above and everything worked perfectly. Let&#8217;s look at why that happened. The first step is to look at the new query plan for the delete after the index create:</p>
<div id="attachment_542" class="wp-caption aligncenter" style="width: 887px"><a href="http://adventuresinsql.com/wp-content/uploads/2010/09/DeleteWithSeek.jpg"><img src="http://adventuresinsql.com/wp-content/uploads/2010/09/DeleteWithSeek.jpg" alt="Query plan for delete statement with index yielding a seek" title="DeleteWithSeek" width="877" height="132" class="size-full wp-image-542" /></a><p class="wp-caption-text">Query plan for delete statement with index yielding a seek</p></div>
<p>The final proof that I have fixed the deadlock by adding an index is to look at the transactions report. If the index fixed the problem the report should show that the update lock has disappeared. Here is the report:</p>
<div id="attachment_544" class="wp-caption aligncenter" style="width: 760px"><a href="http://adventuresinsql.com/wp-content/uploads/2010/09/AfterIndex.jpg"><img src="http://adventuresinsql.com/wp-content/uploads/2010/09/AfterIndex.jpg" alt="Locks after index was added" title="Locks after index was added" width="750" height="602" class="size-full wp-image-544" /></a><p class="wp-caption-text">Locks after index was added</p></div>
<p>The update lock is gone and so is the deadlocking. Adding an index to the table has resolved my deadlock problem. The test that I did here used a clustered index but the same results would be available with a non-clustered index.</p>
<p>I know this was a long post. Thanks for sticking with me all the way to the end.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bnEOMw8XZpg:5boO0Xx0PkI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bnEOMw8XZpg:5boO0Xx0PkI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=bnEOMw8XZpg:5boO0Xx0PkI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=bnEOMw8XZpg:5boO0Xx0PkI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=bnEOMw8XZpg:5boO0Xx0PkI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/bnEOMw8XZpg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/09/can-deadlocks-be-resolved-by-adding-an-index/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/09/can-deadlocks-be-resolved-by-adding-an-index/</feedburner:origLink></item>
		<item>
		<title>A Little Help with Azure Please</title>
		<link>http://feedproxy.google.com/~r/AdventuresInSql/~3/gURCDK_Syzs/</link>
		<comments>http://adventuresinsql.com/2010/09/a-little-help-with-azure-please/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 15:00:48 +0000</pubDate>
		<dc:creator>David Levy</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Sql Azure]]></category>
		<category><![CDATA[SSC]]></category>

		<guid isPermaLink="false">http://adventuresinsql.com/?p=522</guid>
		<description><![CDATA[Buying into the cloud was the easy part. Getting to the point where I can convince people in my organization that they should put their application in the cloud is another story. This is where I could use your help today. <a href="http://adventuresinsql.com/2010/09/a-little-help-with-azure-please/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Not long ago Microsoft announced a new product called Azure AKA &#8220;SQL Server in the Cloud&#8221;. I have to say that when I first heard about the product I was skeptical. The problem I had is that I already have servers, lots of them in fact. I struggled to find any reason that would make me want to spin up a new server in the cloud. A presenter at a user group meeting changed that for me. The presenter threw out the example of the one-off charity campaign web site that many of us have to spin up with little notice then tear down after about a month of use. The lights went on, I got it. I now had an option that was even lighter than a VM and could be spun up faster.</p>
<p>Buying into the cloud was the easy part. Getting to the point where I can convince people in my organization that they should put their application in the cloud is another story. This is where I could use your help today. I have the easy parts of the argument down. The big thing is time. I can spin up a new Azure database in a couple of hours, while it could take a day or more to get a VM or server spun up depending on how isolated the application needs to be and how busy the respective teams are. Another interesting benefit is that the way the billing is set up it really makes it easy to track return on incubator type projects. </p>
<p>I get the great parts of the cloud but there are still some things I could use help with. Here are the questions I have not had much luck finding answers to or have not dug into yet (I thought of 1 or 2 questions as I was writing this):</p>
<p>How secure is my data?</p>
<p>This is a big one. How can I prove that my data is secure both in the database and over the wire? I have heard anecdotally that data can be encrypted at the application before being sent over the wire and stored in the database but how would this look? What would performance be like?</p>
<p>How do backups work?</p>
<p>Can I back up a database to restore to an internal server or restore a database from a local backup to Azure? Would I still have the opportunity to manage recovery like I do on servers I own?</p>
<p>How does maintenance work?</p>
<p>Can I / do I need to set up the usual maintenance jobs to keep indexes and statistics up to date, check for corruption, etc.?</p>
<p>What is support like?</p>
<p>This is sort of a double question but how do I monitor the performance of my database in the cloud? Are there any tools available that make it easier to proactively monitor for issues? What kind of support can I expect if I do have issues? Is there someone I can call? Is there someone monitoring that will call me? Am I expected to be able handle things on my own?</p>
<p>What about DR?</p>
<p>In the Azure demo I saw I distinctly remember the presenter referring to a Chicago data center. Is that a single data center located near Chicago or a group of them that share the load? Would I need to plan for the possibility that natural disaster or a fiber seeking backhoe could knock my database offline? Would my database move to another data center somewhere else in the world and just run a little bit slower until my chosen data center is back online?</p>
<p>So there you have it. Those are my concerns about moving data to the cloud. Overall, I think the cloud will be huge, although I do not know enough about it to know if I am ready to add it as a tool in my toolkit yet. If you know the answer to any of my questions please feel free to leave them in the comments  below. Thanks for taking the time to hear me out and share any knowledge you may have.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=gURCDK_Syzs:GXDGz22kAzg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=gURCDK_Syzs:GXDGz22kAzg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=gURCDK_Syzs:GXDGz22kAzg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AdventuresInSql?a=gURCDK_Syzs:GXDGz22kAzg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AdventuresInSql?i=gURCDK_Syzs:GXDGz22kAzg:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AdventuresInSql/~4/gURCDK_Syzs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://adventuresinsql.com/2010/09/a-little-help-with-azure-please/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://adventuresinsql.com/2010/09/a-little-help-with-azure-please/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 1452/1684 objects using disk: basic

Served from: adventuresinsql.com @ 2012-05-03 08:20:29 -->

