Solved

Best way to use SSMS intellisense when querying

Posted on 2016-10-29
5
107 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 66

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 29

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 29

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 51

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 29

Expert Comment

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

Regards,
Pawan
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

627 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