SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

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…

Filed under: Blog Tagged: QuickTips, Red Gate, SQL Prompt, syndicated

The Voice of the DBA

Steve Jones is the editor of SQLServerCentral.com and visits a wide variety of data related topics in his daily editorial. Steve has spent years working as a DBA and general purpose Windows administrator, primarily working with SQL Server since it was ported from Sybase in 1990. You can follow Steve on Twitter at twitter.com/way0utwest


Leave a comment on the original post [voiceofthedba.wordpress.com, opens in a new window]

Loading comments...