Mastodon

Embracing guesswork with SQL Prompt partial matches

Who here has become rather dependent on Visual Studio’s intellisense? C’mon, be honest, no matter hard-core you are or how impure you think intellisense is you always end up using it to some degree, even if it’s just for discovering object behaviours.

Back when Visual Studio 2010 launched we got some pretty nifty improvements in intellisense which were previously only available by way of third party tools like ReSharper. The improvements included the ability to partially match a string anywhere within the possible result set and the ability to match by Pascal and camel case. Today, Red Gate brings these features to SQL Prompt.

Getting experimental

First up, get yourself SQL Prompt. Try it for free for a couple of weeks, realise you can’t live without it then spend a couple of hundred sensible dollars on something that will make your SQL life a lot happier.

Once running, the partial matches are bundled up under the “Experimental Features” option:

The "Experimental Features" menu item

There are a few neat additions here – some of which I’ll come back to in another post – but for now, enable the “Partial Match Selections” checkbox and we’re done:

Enabling partial match searches

Getting back to why this is actually useful, I needed to check some data in ASafaWeb this morning and for the life of me I couldn’t remember the name of the ASP.NET membership provider view I wanted beyond the fact that it contained the word “User”. Now I could have gone and moved away from the keyboard, grabbed the mouse opened up the object explorer, drilled down into the views and found it, but frankly all that sounds a little like hard work. Plus it’s also dreadfully inefficient.

So here’s what I did:

Partial match on consecutive characters

See how that works? Every object I can select from that contains the string “us” is shown in the intellisense list. Key down, select the object, job done.

Just like Visual Studio, you can also match based on Pascal or camel case – you don’t have to make sure there are consecutive matching characters:

Partial match on camel case

Like in Visual Studio, this works really well when you know the name of the object you’re looking for and want a shortcut for auto-completion, particularly when there are a large number of objects in the database.

Summary

Like many of the Red Gate features I know and use daily, this is a small, unobtrusive addition which gives you back that little bit of productivity every time you use it. These little bits matter – lots – particularly when you expand that out over long hours across many weeks and months.

Red Gate SQL Prompt
Tweet Post Update Email RSS

Hi, I'm Troy Hunt, I write this blog, create courses for Pluralsight and am a Microsoft Regional Director and MVP who travels the world speaking at events and training technology professionals