Solved

Best way to use SSMS intellisense when querying

Posted on 2016-10-29
5
70 Views
Last Modified: 2016-11-03
HI,

We  want some tricks on using best way the the Microsoft SQL Server Management Studio Intellisense.  We know that this tool helps one when querying but for some reason it's not working with us.  We would like to:

    - Type 'select' then being ask the table.

    - If we type 'select table-name' and place the cursor after 'select' we would like to be
      displayed a list of column for that table (without haing to place 'table-name C'.

    - or if there some short we can store statements for faster scripting.

    - Finally, any other good practice in time-saving query-typing any EE can help in.[/list]
0
Comment
Question by:rayluvs
  • 3
5 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 41865523
You should be able to type SELECT {return key} FROM {table name}, then click back to the first line after the SELECT, and start typing columns.  Without the FROM clause IntelliSense has no idea what tables is needed to populate the column list.

You may have to change the selected database just in case your SSMS is using something like master as the default.
0
 
LVL 28

Accepted Solution

by:
Pawan Kumar earned 250 total points
ID: 41865592
In addition to What Jim sir has mentioned, if you have a long column list then you can do below-


You can select the table name and drag the columns so that you dont have to type huge list of columns. Drag a comma separated list of all Columns from Object Explorer window to the Query Window.


EE column...
Also some times the IntelliSense does not work- in that case you have refresh the local cache.

EE clear cache.
Another good tip is you can search any object from below.

EE object search

Hope it helps !!
0
 
LVL 28

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 250 total points
ID: 41865594
Hi,
One more update if you want to learn more in SSMS area, there a blog which is dedicated in this area-

http://www.ssmstipsandtricks.com/

Hope it helps!

Regards,
Pawan
0
 
LVL 47

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
ID: 41866709
- Type 'select' then being ask the table.
You can't. After SELECT is expect a constant or a list of column names. Jim already said how to do the trick by adding the FROM clause.

- If we type 'select table-name' and place the cursor after 'select' we would like to be displayed a list of column for that table (without haing to place 'table-name C'.
As I said above, after a SELECT isn't a column name that's expected. You can add another SELECT, functions, variables or constants and those are things that Intellisense is showing you. To restrict only to column names you'll need to provide the table, view or alias so the related columns will be listed.


- or if there some short we can store statements for faster scripting.
- Finally, any other good practice in time-saving query-typing any EE can help in.
For both options you can use templates. Those are scripts that you should only need to write them once an store them in the disk for later use with the Template Explorer.
TemplateExplorer.PNG
0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41871709
Hi,
Appreciate a feedback on this.

Regards,
Pawan
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question