SQL Prompt

SQL Prompt

The Louis Davidson custom style for SQL Prompt

My previous article in this series explained why it’s important for a development team to adopt a common standard for formatting SQL code. It also gave a broad overview of the styles and actions within SQL Prompt that can help define and implement that standard. Unfortunately, many teams avoid the topic of a standard code […] Read more

SQL Prompt

How to implement a SQL formatting standard using SQL Prompt v8

With ten programmers working on the same project, how do you agree on a standard style for formatting SQL code, and then implement it consistently? One way is through draconian rules, meeting after meeting, and the occasional sacrifice of a programmer to put the fear in those who remain. If that doesn’t sound like fun, […] Read more

SQL Prompt

How to implement a T-SQL code formatting standard using SQL Prompt

To what extent should a team attempt to impose a uniform SQL coding format? It can sometimes seem like a futile task. All programmers have a preferred formatting style, to which they profess an unwavering attachment. Check the code of ten programmers, though, and you will likely discover at least 15 different formats, since few […] Read more

SQL Prompt

3 Results Grid features SQL Prompt brings to SSMS

You may not have heard about it yet, but three helpful features were recently added to SQL Prompt that are activated when you right-click on the Results Grid in SQL Server Management Studio (SSMS). 1. Copy as IN clause This feature is available when you have values from a single column selected. You can select […] Read more

SQL Prompt

Quick SQL Prompt tip – restore your tabs, even if you closed them by mistake

It’s sometimes too easy to close SQL Server Management Studio (SSMS) without saving your work. It’s also easy to get rid of tabs and scripts that you later wish you had back. SQL Prompt can help with both these problems. Take a look at the Options for SQL Prompt and you’ll find a set of […] Read more

SQL Prompt

Quick SQL Prompt tip – picking the columns you need for speedy results

One of the poor practices that I see so many people doing in code is using SELECT *. This is poor practice because it takes more time to complete for clients, it’s an unnecessary use of resources on the client, server and network, and it can fill the buffer cache with rarely-used data. For example, […] Read more

SQL Prompt

Quick SQL Prompt tip – script objects as ALTER in two clicks

Working in a large database can be difficult at times. While many of us might learn the meanings and definitions of most objects, it’s easy to forget the exact ways in which some objects work, or what the behavior is in certain calls. This is one place where having tools that assist you like SQL […] Read more

SQL Prompt

Faster SQL Server troubleshooting using SQL Prompt snippets

A good DBA will automate repetitive tasks, but sometimes you need to troubleshoot a problem ‘live’, with people standing over you, and the pressure on. This is something that can’t be automated. SQL Prompt snippets have helped me out in this sort of situation numerous times. Built-in SSMS query shortcuts SSMS provides a few shortcuts […] Read more

SQL Prompt

Quickly rename variables all at once with SQL Prompt

You’re going to run into situations where someone has made poor choices in naming objects, or maybe the business logic has changed and the object name no longer makes sense. Either way, easily and quickly taking care of renaming the objects within scripts can be a pain. Let’s take this code as an example: The […] Read more

SQL Prompt

Quick SQL Prompt tip – using the CDB snippet

SQL Prompt includes a number of snippets by default that can help you quickly write T-SQL code. These are templates of code that users use regularly. One of the more popular snippets is the ‘cdb’ snippet that helps with quickly creating a new database for development work. This can also be used to ensure production […] Read more