I am not sure if this is possible, but when writing a query to select from a table, when I bring up the intellisense drop down with CTRL + Spacebar, it gives me a list of all variables (global, and on the table).

enter image description here

Is there any way to make this only show the variables in the table I am selecting from? Its basically completely useless unless you know the name of the field already, so then what is the point of the intellisense drop down?

  • 2
    When you are saying "variables in the table", do you mean "columns"? – Andriy M Mar 14 '18 at 14:57

Intellisense, however intelligent it may strive (or claim itself) to be, cannot possibly know that you only want columns in that context. Without that piece of information, therefore, the list will include all items that are valid in the given context.

If you want to make it clear that you are only interested in selecting the table columns, you could qualify the column names with the table name and the syntax will restrict the number of available tokens for you.

Consider this:

without table name

Same as in your example.

Now look at this:

with table name

You can see that the list only has the column names. To make this easier, I would further suggest you use short aliases for tables, like this:

with short alias

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.