Quick Tips – SQL Prompt Stop the Yelling

I love SQL Prompt, and think it’s a great productivity tool. Even before I worked at Red Gate, I love the tool and had a copy before Red Gate bought the technology from the original developer. Recently I’ve run into a few people that weren’t aware of some of the ways in which it can help you. This is a quick look at one of the ways I use SQL Prompt.

Lower Case Keywords

One of the things that many developers like is lower case keywords. If you examine some C# code, you’ll often find that they have keywords in lower case. For example, here’s a sample from MSDN.

// versioning.cs
// CS0114 expected
public class MyBase 
   public virtual string Meth1() 
      return "MyBase-Meth1";
   public virtual string Meth2() 
      return "MyBase-Meth2";
   public virtual string Meth3() 
      return "MyBase-Meth3";

When I’ve gotten projects from Red Gate, I see something similar.

However, if I enter some code in Management Studio, by default, SQL Prompt will format it like this:


Notice the upper case keywords. Personally I like these, but many developers may not. Fortunately there’s an easy fix. Access the SQL Prompt menu in Management Studio and select options (circled below).


This will bring up the options dialog. Select the CASE item as shown below.


On the upper right side, you’ll notice that you have drop downs for keywords, built-in functions and data types. By default these are all set to uppercase. However you have a number of choices.


I’ll change mine to lowercase, click OK, and then reformat my code. I now see this.


Quick and easy, and I can now read code that looks more like what developers are used to. Maybe I’ll leave things set like this…

You can see a complete list of SQL Prompt tips at Redgate.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , , . Bookmark the permalink.