Solved

Best way to use SSMS intellisense when querying

Posted on 2016-10-29
5
47 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 18

Accepted Solution

by:
Pawan Kumar Khowal 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 18

Assisted Solution

by:Pawan Kumar Khowal
Pawan Kumar Khowal 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 45

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 18

Expert Comment

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

Regards,
Pawan
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now