Blog Post

SQL Prompt Prevents Stupidity

,

I upgraded my SQL Prompt recently, mostly as a habit. The team led by David and Aaron are always adding cool new features, and have almost never broken my flow, so I usually take the changes they’ve made whenever they appear. In this case, I got an unexpected surprise.

While demoing some tSQLt stuff, I wanted to show how to install the framework. I loaded the tsqlt.class.sql file and clicked Execute. What I saw was this:

2016-06-01 19_09_49-06_testingtsql_install_tSQLt.class.sql - JOLLYGREENGIANT_SQL2014.SimpleTalkDev_S

In the middle of my SSMS window was a warning. I’ve got multiple items without WHERE clauses in the script. There are deletes, and in this case they don’t matter. However I got a warning. I could stop execution or execute.

This made me pause in front of the audience for 10 seconds while I read it, but I clicked “Execute anyway”, things worked, and I went on.

However, that was cool.

I tried this in other ways. Suppose I had an UPDATE without a WHERE.

2016-06-01 19_11_06-SQLQuery2.sql - JOLLYGREENGIANT_SQL2014.TestingTSQL (JOLLYGREENGIANT_sjones (63)

Same warning. That’s a good one. What if I highlighted just part of a script?

2016-06-01 19_13_21-SQLQuery2.sql - JOLLYGREENGIANT_SQL2014.TestingTSQL (JOLLYGREENGIANT_sjones (63)

I can’t tell you how many times I’ve done this in a presentation. Or in production, where it’s happened a few times. I could turn off the warning, but I love it. This is exactly what I need to prevent me from doing something stupid that I didn’t mean to do.

If I want to clear a table, and sometimes I do in demos, I click “Execute”. However, if I’ve made a mistake, I just hit enter, take the default, and then fix things.

I love SQL Prompt, and it’s one of my favorite tools from Redgate. I also love the development process, with the team working against submissions and requests from users, and responding with small releases hundreds of times a year.

If you’ve got SQL Prompt, be sure you update to v7.2. If not, then download it and give it a try. I think if you spend a good two weeks working with it, customizing snippets, and practicing some of they keystrokes, you’ll love it as well.

Filed under: Blog Tagged: Redgate, SQL Prompt, syndicated

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating