filmov
tv
SQL Prompt - highlighting matching objects

Показать описание
In this tip Data Platform MVP Grant Fritchey explains how to use SQL Prompt to highlight matching objects, which'll help you clearly differentiate between objects and aliases using the same name in large scripts.
Transcript:
Hello my name is Grant Fritchey and I work for Redgate Software. Today I want tell you another tip about SQL Prompt. Now I've got a stored procedure I’m working on here and there's a lot going on – there’s stored procedures joining to a whole bunch of different tables, I've got a where clause, order by, and I’m referencing a lot of stuff it's. Actually it's kind of starting to get difficult to work with.
Now I could use ctrl f, let's say I'm looking up ‘preferred name’, that value there. But I've got a preferred name here, preferred name here, preferred name here, preferred name here, preferred name here, and I’m also using it down in the where clause, order by, oh my gosh I’m getting lost.
However SQL Prompt comes in and I can highlight this preferred name. You'll notice no other preferred names are highlighted but if I scroll down I will find the preferred name that I want to reference is highlighted. And the same thing goes with an alias: if I want to use preferred name say primary preferred name it will highlight that alias for me, and you'll notice the others are not highlighted, but the alias where it is used is again highlighted. That’s SQL Prompt giving me help finding stuff within my store procedure. Thanks my name is Grant Fritchey and I work for Redgate Software.