Thursday, January 29, 2015

Powershell scripting - an advanced lesson

Intro:


So you now kind of know what powershell scripting is, and there's a better way of scripting via a Microsoft utility included with Windows 7 and newer OSes.  You now have even used a parameter in your script so it's re-usable for different machines.  What else is available?  invoking a web service and displaying the results to the user!

Coding:


I'm rather fond of the parameter based concept for these scripts, methinks I'll use one.  I found a handy dandy free soap service on the internet that converts Celsius to Fahrenheit (hey, it could be useful for the metric system users out there).  Time to break out a cmd-let called New-WebServiceProxy.  As you can see in the following code it's quite easy to invoke a web-service in your script:

param(
    [Parameter(Mandatory=$true)][string]$conversionValue
)

$svc = New-WebServiceProxy http://www.w3schools.com/webservices/tempconvert.asmx
$result = $svc.CelsiusToFahrenheit($conversionValue)
write-host "You entered " $conversionValue "degrees celsius and it converted to " $result "degrees fahrenheit"

You basically make a local variable and pass the URL as the parameter to the New-WebServiceProxy.  from there you call the variable.MethodName and pass any parameters that might need to be used and store the results in a variable to do what you wish.  For our purposes I'll write out the results .

Time to run the script, check out the results:








Huzzah!

Source:


Friday, January 23, 2015

The COUNT Function & NULLs


I'm still a bit under the weather from this cold so I'm going with a short and simple refresher this week.

We all at one time or another have used the SQL COUNT function to look at how many rows of something exists. Some of us have learned the hard way that you have to be careful when using this function. At the very least I hope to give you something to think about.

Let's create a table in our TestDB with this script.

CREATE TABLE [dbo].[tblTestCount]
(
   [id] [int] IDENTITY(1,1) NOT NULL,
   [AllowNulls] [int] NULL,
   [NoNulls] [int] NOT NULL
) ON [PRIMARY]
GO

Now lets put some data into the table.

INSERT INTO tblTestCount ([AllowNulls], [NoNulls])
VALUES (1,1)
,(1,0)
,(null,5)
,(5,4)
,(null,4)
,(3,3)
,(8,10)

Here are the queries we're going to run against the table. Before you run it, write down what you think the results for each query will be. 

SELECT COUNT(1) AS [Query1] FROM [dbo].[tblTestCount]
SELECT COUNT(*) AS [Query2] FROM [dbo].[tblTestCount]
SELECT COUNT([id]) AS [Query3] FROM [dbo].[tblTestCount]
SELECT COUNT([AllowNulls]) AS [Query4] FROM [dbo].[tblTestCount]
SELECT COUNT([NoNulls]) AS [Query5] FROM [dbo].[tblTestCount]
SELECT COUNT(DISTINCT [AllowNulls]) AS [Query6] FROM [dbo].[tblTestCount]
SELECT COUNT(DISTINCT [NoNulls]) AS [Query7] FROM [dbo].[tblTestCount]
SELECT COUNT(DISTINCT *) AS [Query8] FROM [dbo].[tblTestCount]


Did you get them correct? What if anything can you take away from this? Next week, removing duplicate data.

Thursday, January 22, 2015

Powershell Scripting - an intermediate lesson with digital signing

Intro:

So by now you're thinking: hey, powershell might not be so bad after all, but what's up with those weird user rights?  It's understandable in this day and age people will try to attack your machine in order to make bank, time to bullet-proof your scripting by digitally signing your scripts.  Your last script you probably ran from the powershell window, but now it's time to fire up an IDE of sorts supplied by Microsoft:  Windows Powershell ISE!  You can read/execute your scripts from the editor along with having a console attached at the bottom to fire off any standalone powershell commands needed along the way.

Coding:


Now for an important part: changing permissions on your local machine (or wherever you're going to execute your script) to be able to execute the script.  In the last blog I'd discussed how to do that, the option we're going to use this time around is AllSigned.  This options allows scripts to be ran if the publisher is trusted.  If they're not trusted they won't be executed.

Lets start off with a more advanced powershell script than before, lets write a script that passes the machine name as a parameter so you can see what time the machine booted up.

The code:
<#
.SYNOPSIS
.DESCRIPTION
Gives startup time of the pc the script is executed from
.PARAMETER ComputerName
name of computer the script is running on
.EXAMPLE
.\test.ps1 -ComputerName localhost
#>
param(
    [Parameter(Mandatory=$true)][string]$ComputerName
)

Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName |
Select-Object -Property CSName,@{n="Last Booted"; 
e={[Management.ManagementDateTimeConverter]::ToDateTime($_.LastBootUpTime)}}

# end of script

As you can see adding a parameter isn't the most difficult concept on earth, but powershell advanced it quite a bit: mandatory usage as well as data type enforcement.


So what the script does is fire off a commandlet called Get-WmiObject that helps connect to whatever class you desier.  In this case we're going to call the Win32_OperatingSystem object to pull some info from the machine in question (our parameter we're passing) and then display it to the user in a nicely displayed format.

Okay, now we have a script, lets tweak it by adding a site certificate.  This example has cheesily been named test.ps1.  The command you'll want to fire off first is "get-childitem cert:\CurrentUser\my -codesigning" (all text within the double quotes) which can be done from Powershell ISE.  You should see results like the following:








Time to execute that script.  .\test.ps1 localhost OR .\test.ps1 -ComputerName localhost should give you a popup like the following:





Choose run once and you should receive something like the following:





Huzzah!  Our script has a certificate and passes a parameter.  Even better, check out the weird time of day the computer in question started.  Go look at your source code again, you'll see a newly added signature block associated with your script.

Enjoy!

Source:


scripting sample
script signing

VS 2010 Web Deploy Projects and web.config File Section Replacement

Intro

Let's pretend you want to have a different web.config file for live vs qa vs dev. If you're working on a web site (not web application) in Visual Studio you don't have access to web.release.config and web.debug.config, the easiest of the transformation methods. However, don't fret! With a web site you still have the option of creating a Web Deployment Project and enabling web.config file section replacement.

Why might you want to use this? Here's one common scenario. It's common knowledge that in the compilation element of your web.config, you don't want to leave it set to debug="true" in your production deployment. This has both security and performance implications and is just a good idea to have your site set to live mode rather than debug mode. Using web.config file section replacement with a Web Deployment project makes this quick and easy.

Creating a Web Deployment Project

For the remainder of this blog I'm assuming you already have a VS2010 solution with a web site project in it. If not, find one or create one. Onward...

Step #1 in getting all this going is creating a Web Deployment Project. Open up your VS 2010 solution (feels weird doing that; I've done nothing but VS2013 for this blog so far). Hey I suppose this probably works in VS2013 too, I just haven't tested it there. But I digress. Right-click the web site and select "Add Web Deployment Project...".


Name it whatever you like on the next screen and click "OK" when ready.


That was painless. You've got your first web deployment project ready to roll.



Web.config File Section Replacement

Open up the web.config if your site and scroll down to the "compilation" tag. It probably looks something like this:

    <compilation debug="true" targetFramework="4.0">

It's that debug attribute we want to do something about. You want to leave it true when you're debugging, as it makes debugging possible. But when you push this somewhere that the outside world can get at it, say on a production server, you want that set to false as it's more performant and more secure than the alternative. Let's do this! Right-click on your new web deployment project and select "Property Pages". On the window that comes up, click on "Deployment" in the left-side view. Check the box that says "Enable Web.config file section replacement" and put the following text in the big textbox: "system.web/compilation=web.compilation.config;". I tend to do this for both the Debug configuration (the drop-down in the upper-left) as well as the Release configuration, and if you're not sure which build configurations are used for what just do this in both of them. Click OK when you're done.


That's half the picture; we told the web deploy project to use a file called web.compilation.config, but that file doesn't exist yet. Create this file in your web site. Open up your web.config, copy the contents of the "compilation" tag and it's children, and paste it all into your new web.compilation.config file. Now set that debug attribute to "false" in the web.compilation.config file and save it. Mine looks like this, yours will be similar (though my sub-tags are probably different):

<compilation debug="false" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </assemblies>
</compilation>


Arrsome! Now we have web.config file section replacement running, so what do we do with it? Post the site!

Deploying The Site Manually

The simplest method of posting your site to take advantage of replacement is to just copy the files. Right-click on the web deployment project and select "Build". When it's done building, right-click the web-deployment project in VS again and select "Open Folder in Windows Explorer". Open up either the "Debug" or "Release" folder (depending on which build configuration you're using), and voila! Them files be yer website. If you want to verify that your web.config file was properly transformed, just open it up from this folder and find the compilation element. It should have debug set to false.

Caveats

Web deployment projects are kind of slow to compile. For that reason you don't want to build the deploy project every time you compile your website. You can tell VS to only compile your web deploy project when you explicitly compile it (by right-clicking it and selecting "Build"). To do this, right-click your solution in VS and select "Configuration Manager...".


 On the Configuration Manager screen select the solution configuration(s) you want to change (I usually set both Debug and Release), and uncheck the "Build" checkbox for the deploy project. Click "Close" when you're done and save everything. Now when you build the solution the deploy project won't compile.



What's Next?

Web applications (not web sites) have a cleaner method of web.config transforms, using web.debug.config and web.release.config. Play around with it, see if you like it.

You could also see what other transforms are possible using the above method. Hint: You can transform just about any element, not just the "compilation" element!

Thursday, January 15, 2015

Powershell scripting - a beginner's lesson

Intro:


Ever enjoy shell scripting in Unix and wonder if Microsoft ever implemented such a device?  yes they did!  Windows has offered it since Server 2k3 and it comes standard with Windows 7 and newer OSes offered up to us.

Some coding:


Lets create an easy-cheesy sample script you can run on your local to see a few (very few) features available.  We could use the classic Hello World, but for my purposes I'll go a little bit l33t for my script sample.

The easiest way to create a script is to fire up the text editor of your choice and get to scripting.  You can create comments in your script (quite useful for pseudo-coding what you want to do) via the pound sign (#).

The simplest script command that exists is called write-host.  For those of you old school enough to remember the greatness of echo in dos command line batch files this is an equivalent.

The following is a quick script I created called test.ps1:
# test.ps1
# here's a comment
write-host
write-host 'scripting roxors!'
write-host 'fridays roxor!!'
# end of script

After you've saved your script you'll want to see what happens.  Open up Windows Powershell via Accessories | Windows Powershell | Windows Powershell and navigate to your script.  To execute it: type .\test.ps1 (or whatever you named it) and hit enter.  Most users will receive an error like the following:


The quick solution to the problem in front of you: User rights!  There are 4 options available for execution rights: Restricted (the default), AllSigned (only scripts by trusted publishers are executable), RemoteSigned (downloaded scripts have to be signed by a trusted publisher to be executable) and Unrestricted (no restrictions, no security however).

TEMPORARILY change the security of your scripts by the following command: Set-ExecutionPolicy Unrestricted.  Now run your script, you should see the following output:

Huzzah!  Don't forget to put your security settings back via the command: Set-ExecutionPolicy Restricted.  Hey, at least the commands aren't case sensitive :)

Tune in next week where I talk about some real commands available that can be scripted along with signing your script so security settings aren't as much of a hassle.

Resources:


powershell rights

Thursday, January 8, 2015

CSS3 Transforms


Intro

CSS3 has been around for a few years now. Prior to CSS3 and HTML5 we all lived in the dark ages. I'm pretty sure dinosaurs roamed the earth, Republicans were Democrats, and humans had just learned to fashion clubs. No electricity even! But now with CSS3 we can do a whole lot more on our not-as-primitive-as-before web pages, making them look ever-so-pretty. CSS3 does quite a bit more than just transforms, but this is a blog not a novel so we'll stick with just this one topic for today.

What They Be?

What are CSS transforms? Well they're CSS actions (a single property within a style-sheet definition) that you can use on your tags. I mostly like to use them on images, but they're valid on divs, spans, whatever. It's a nifty way to get cool 2D and 3D actions performed without having to write complicated modification routines using JavaScript.

Example Set #1: 2D Transforms

What all 2D CSS transforms can you do? Rotate, Scale, Skew, Translate. What Are they? Here's a quick example that shows 4 transforms on groovy-looking images.

control
rotate 90°
Scale (x: 1.5, y: 0.5)
Skew (x:10°, y:45°)
Translate (x:30px,y:10px)
 
It might be kinda tough to tell exactly what this did so I'll break it down. The control image has no transformation. It's just a standard HTML image. The rotation transform rotates the image as though it were the hands of a clock. Scale scales your image by the amount given in the parameters, where 1.0 is the same as 100%. Skew stretches/smushes (good technical term huh) your image. I like to think of it as though somebody were to pull on opposite corners of the element, with the corners and direction determined by x/y and the angle. The translate transformation moves your image by the amount specified.

Here's the code used to generate the above effects:

<style type="text/css">
.rotate {
transform: rotate(90deg);
}

.scale {
transform: scale(1.5, 0.5);
}

.skew {
transform: skew(10deg, 45deg);
}

.translate {
transform: translate(30px, 10px);
}
</style>

<div style="float: left;">
control< br />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
rotate 90&deg; < br />
<img border="0" class="rotate" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
Scale (x: 1.5, y: 0.5)< br />
<img border="0" class="scale" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
Skew (x:10&deg;, y:45&deg;)< br />
<img border="0" class="skew" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
Translate (x:30px,y:10px)< br />
<img border="0" class="translate" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="clear: both;">
&nbsp;
</div>


Cool huh? 2D transforms are fun to play with. But guess what? CSS3 does 3D transforms too!

Example Set #2: 3D Transforms

So yeah, like I said, it's time for some 3D transforms. You can do many of the same 2D transforms as 3D transforms, such as rotation, scaling, and translating. Let's look at a slew of samples again to get a feel for what we can do:

control
rotate x30°,z20°
scale x 1.3
translate z 50px

Let's take a closer look at these homeys. Control is still the control image, no transforms. the 2nd image rotates on the x-axis 30 degrees and the z axis 20 degrees. Image numero tres scales the image on the x-axis by a factor of 1.3, and the final image translates the image on the x-plane by 50px (brings the image forward 50px thus putting it on top of the 3rd image).

Here's the code used in them thar samples:

<style type="text/css">
.rotatey {
transform: rotateY(30deg);
}
.rotatez {
transform: rotateZ(20deg);
}
.scalex { 
transform: scaleX(1.3);
}
.translatez { 
transform: translateZ(50px);
}
</style>

<div style="float: left;">
control< br />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
rotate x30&deg;,z20&deg;< br />
<img border="0" class="rotatey rotatez" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
scale x 1.3< br />
<img border="0" class="scalex" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="float: left;">
translate z 50px< br />
<img border="0" class="translatez" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitU3xEzE_sCgKe4bMn6K_zmIvbXUqGZPt5ALApt-G1xQAFHaTf40dvrrSQiRhfil3OIfSEOnwqkUv_2yb4Om0i4R79__sBVLMRTg33e_A82_lMmkxAtqeuykU1ExNAH7y-5F5jyjQx8wOR/s1600/monster-icon.png" height="100" width="100" />
</div>
<div style="clear: both;">
</div>



Pretty cool stuff! You can make lots of nifty effects with just some CSS, HTML and time.

What's Next?

Take a look at the resources below, play around with transforms yourself. There's more I didn't cover though it's all pretty similar. Get yerself a beverage of your choice and have at it for an hour or two, see what shakes out.

Resources

CSS3 Transform Property
CSS Transforms
CSS3 2D Transforms

Thursday, January 1, 2015

SSMS Third Party Tools

Introduction

My last BLOG covered tips and tricks to make using SSMS more efficient and friendly. This week we'll cover some third party tools that will save you some serious time and trouble while working with SQL server. Most of the major players in the third party market have free products they offer in a free tools download area for the cost of registering with them. We are only going to scratch the surface again in regards to what is available. I invite you to look around and see what you can find. Check out the links in the resource section at the bottom.
  

Tools

SQL Search
The first tool I'm going to cover is from Red Gate Software and is called SQL Search. This application is a free plugin for SSMS that assists with tracking things down in SQL server. Click the link in the resources section and install it into your SSMS.

Click the toolbar button it adds on the left of your GUI. A tabbed page will appear allowing you to select the server, database, object types to search and an entry for a search value. This is an invaluable tool when making changes to a database you are not familiar with, or need to quickly find all references to an object.






























Let's say you need to add a column to a table in a database and someone coded a stored procedure that truncates and inserts the values from this table into a table in another database using something like:

DELETE FROM AnotherDB.dbo.AnotherTable
INSERT INTO AnotherDB.dbo.AnotherTable
SELECT *
FROM dbo.TableImModifying

Believe me, it does happen! This is a great example of why we want to use a column list when we're selecting information. When we add the column to TableImModifying we're going to break the stored procedure that updates AnotherTable in AnotherDB. By doing a quick search server wide with SQL Search for TableImModifying we'll find the reference and either modify the table AnotherTable in AnotherDB or better yet, change the stored procedure to use a column list, the latter of which assumes the column you are needing is not needed in AnotherDb.dbo.AnotherTable. You get the picture!

There are other add-ins available from Red Gate you can look at by clicking the Add-Ins button on the tool bar next to search. Some cost money, some are free. Look around and see what else they have that you could find useful. SQL Compare is another great tool in my tool belt and is well worth the licensing fee.


SSMS Tools Pack
The next tool I'm going to talk about is SSMS Tools Pack. This is an add-in package developed by Mladen Prajdic and is made available to the SQL community through his web site linked in the resources below. Versions supporting SQL server 2K5 to 2K8R2 are free to anyone who wishes to use them. Starting with SQL server 2012 version he has started charging a minimal licensing fee for its use. Download and install the package for the version of SSMS you have installed.

The default installation adds the tools as a seperate menu item but you have the option to install it under your Tools menu item. I use the default. When the installation completes restart SSMS and you will have a menu item named SSMS Tools. Click the menu and a sub menu will drop down similar to the one here.


There are many facets to this tool represented in each sub-menu item that are useful and you need to explorer it's documentation fully. I'll hit a few of the high points here.

SQL History: Search Local SQL History will pop open a form that allows you to search through queries that have been run on your machine. There is a date range you can adjust to limit the results returned. You have the option of copying it to the clipboard or opening it in a new window. This is great when you need to run a query you ran some time back and don't want to write it again.



SQL Snippets: These are shortcuts you can type into your query window and when you hit enter they will be replaced with the code associated with them. There are quite a few built into the application when you first install it and you can add your own. If you have a query you use often, you can enter it into snippets and assign it a shortcut and you won't ever have to type it out or load it from file again, Read up on them in the documentation. Below is the snippet INS. If you type this into your  query window and hit enter it will be replaced with the query you see in the right window.



Execution Plan Analyzer: This tool is very good at catching some of the easier problems with queries and offering advice on how to improve them. It is a good starting point though when you need to quickly diagnose and correct an issue in a database you are not acquainted with. You will need to execute the query once with Show Actual Execution Plan. Once the query completes, switch to the execution plan tab and right click the top bar for the sub-menu to enable the plan analyzer. It will show areas of your query that could improve and even offer tips on how to do it.





















Click the Execution Plan Analysis button (1) and then the bar (2) and it will show you things that could be improved.



Brent Ozar First Aid
Brent is a Microsoft SQL Server MVP and has built quite a business consulting on SQL issues that plague many corporations. He is a dedicated blogger and extremely active in the forums. I could talk all day about his greatness. One thing I find admirable about him is that he started from the bottom like most of us with little to no help and he goes out of his way to make sure everyone has the tools available that he wishes he had when he began. I have linked to the first aid kit page on his web site that holds all the free tools and scripts he offers. You may also click the individual links to each of the three tools I'm going to talk about here for their individual pages. I strongly advise subscribing to his blog to continue your progress toward enlightenment.

These are all stored procedures that are geared more toward DBAs than developers using SSMS. If you're a DBA by accident or choice you'll love these. I create them in the [Master] database of the servers I manage.

sp_Blitz; When executed it will examine your server for common performance and health issues.The default execution gives results in a prioritized list with links to information on what it is and how to resolve the problem. There are many parameters that can be used to look at various things and tweak output. Refer to the documentation he provides and watch the video.

sp_BlitzIndex; When this is executed against your database it examines missing and unused indexes as well as existing indexing strategy and produces output with information about your indexes, problems it has found and links to more information for each row.

sp_AskBrent: This one is for when you get the call saying "Your server is running slow". You execute it while the problem exists and it takes in everything going on with the server and returns prioritized listing of issues it has identified with links for more information.


Conclusion

I hope you have found some of these tools to be of interest to you. Dig into them and discover what else they contain that could be of use to you in your daily work. Some of the authors of these tools, scripts, etc. allow donations from their websites. They provide these free of charge for your use but if you find them to have value, think about kicking back a buck or two to help support their further development. See you next week!

Resources

RedGate SQL Search - SQL search plugin for SSMS.
SSMS Tools Pack - Tools, scripts and analyzers.
SQL Sentry Plan Explorer Free - A very good add-in for query plan analysis.
Brent Ozar First Aid - Brent's free scripts. This guy is amazing! Explore his entire site!