This post demonstrates some generic problem reporting steps that I encourage all users, whether developers or nontechnical end users, to follow. SQL Server has a feature that can help. So does Windows in some cases. More on those in Step 3.
Step 1: Is the problem caused by a particular action undertaken on a gui? If so, you should get a screen capture. But if it is caused by executing some T-SQL code in a query window, just copy/paste the offending code as text.
There are several ways to get a screen capture without purchasing a commercial screen capture product. The most appropriate method depends on the circumstances.
- If you just need to get a section of the screen, the Windows 7 Snipping Tool can easily and quickly grab a portion of the screen.
- If you need to capture what the screen looks like with cascading menus showing, you’ll need to press the Prt Scr button and capture the entire screen.
- If you need only a particular window and you’re on a version of Windows that doesn’t have the Snipping Tool, set focus to the window of interest and press Alt Prt Scr. In other words, hold down the Alt button before pressing the Prt Scr button. You’ll capture only the active window. The disadvantage is that any cascading menus will not be captured.
Get a screen capture showing what action causes the error to occur. A large percentage of end users press the Prt Scr button to get a screen capture, which is helpful, but creates an unnecessarily large image. Use Alt Prt Scr instead to capture only the active window instead of the entire screen. Hold down the Alt button before pressing the Prt Scr button. It’s advisable to make the active window as small as possible before capturing it. If your problem is caused only by executing code, a screen capture isn’t necessary. You can just provide the sample code
Step 2: Consider pasting the screen capture into Paint. There are several considerations:
- Does the screen capture contain private, personal information not relevant to the technical problem? If so, it must be removed or obscured.
- Does the screen capture contain a lot of information not really relevant to the actual problem, such as from Prt Scr that captured the entire screen? If so, consider selecting a subset of the image that still retains sufficient context.
- If, for example, clicking a specific button causes the error to occur, it’s best to clearly annotate the screen capture to indicate which button causes the error. A textual description accompanying the screen capture isn’t as convenient as having an annotated screen capture.
- Sometimes it takes more than one screen capture to establish a context.
Step 3: Capture the error message. This is where SQL Server can really help. Many times end users and even developers will send me a screen capture of the entire screen. Not good, particularly when it comes from a 2560x1600 30” monitor! Developers usually are better about this and use Alt Prt Scr to send something that looks like this:
While this is helpful, it isn’t optimal. Much of the time I’m going to end up manually transcribing the error message text into a search engine. It’s not necessary for me to do this when I’m provided a textual version of the error message. Both SSMS and Visual Studio provide a means to copy the error message as text. Take a closer look at the lower left corner of the SSMS error dialog box:
Clicking the icon in the lower left corner captures the contents of the error dialog as text. Here is the textual version of the error dialog:
TITLE: Microsoft SQL Server Management Studio
The Database Engine service could not resolve the specified file location. Either the location does not exist, or the current login account does not have access to it. Verify that the file location exists, and that the login account has permissions on it.
That’s what I want to receive instead of a screen capture. People who should know better don’t always do this even when they can. But what about the times when the Copy message text icon doesn’t appear? Sometimes Windows allows you to capture the contents of a dialog box (it doesn’t have to be an error dialog box, it could be a normal dialog box) even if there isn’t an icon to do so. The first trick is to set focus to the dialog box and use Ctrl-C to capture the textual contents of the dialog box. If it doesn’t work, you move on to the next trick. The next trick is to set focus to the dialog box and use Shift Ctrl-C to capture the textual contents of the dialog box. When either of these tricks work, it’s quite handy. I've seen both techniques work as desired and other times not. If Ctrl-C captures the dialog box as an image, try Shift-Ctrl-C to hopefully capture the textual contents of the dialog box. There isn't one technique that always works, but I have succeeded in capturing the contents of error dialog boxes most of the time.