Solved

How do I set intellisense to work in sql server 2008 r2 sql server management studio?

Posted on 2014-11-23
7
281 Views
Last Modified: 2014-11-24
I installed Adventureworks db to SQL Server management studio.  I can only get one line of code to show intellisense. If I say Select * from sales.salesOrderheader , I cannot get sales.salesorderheader.customerId to come up in intellisense. The sales and salesorderheader display in intellisense. If I write another query below that one, no intellisense at all enables.
Also, this does not work either.

select a.customerid
from Sales.SalesOrderHeader  a
0
Comment
Question by:chaverly
[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
7 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40460962
One thing that I've experienced is that it depends on the context from which you start your query. Does the database dropdown in the top left show "Master" or "Adventureworks"?

If it shows "Master" or any db other than "Adventureworks", change it to "Adventureworks" and it should then see all the objects within that scope.

If no joy, and you have only just added Adventureworks, try rereshing the intellisense cache using CTRL+SHIFT+R or (Edit/Intellisense/Refresh local cache).

For other possibilities, check that you have all service packs and see
this link regarding Visual Studio and possible effect on intellisense

And this MSDN link on intellisense in MSSQL 2008R2
0
 

Author Comment

by:chaverly
ID: 40461154
Yes, I tried all that. Thank you. I even uploaded SP1 for Visual Studio 2010. It works for my access database Xtreme that I change to a mdf, but not Adventureworks or Adventureworks LT. I even ran the regedit cmd to allow as public. I'm at a loss.
0
 
LVL 13

Expert Comment

by:Koen Van Wielink
ID: 40461238
Also, this does not work either.

select a.customerid
from Sales.SalesOrderHeader  a

Do you mean that this query doesn't run, or just that you don't get intellisense?
If the query doesn't run, it probably means the issue is not with intellisense but with access to the database.
Does it work when you add the following line above the select statement:

USE AdventureWorks
Go

Open in new window


This assumes you named your database AdventureWorks. Change it to the proper name if you have to.
Also, the user under which you are logged in, what database role is assigned?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40461597
Try to press <CTRL+SPACE> when the intellisense isn't working.
0
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40461979
One other gotcha.. I connect to various instances from SSMS. One of them is SQL2000 and intellisense doesn't work for queries on that connection. You would have installed Adventureworks to a MSSQL instance. Can you confirm that it is a 2008 instance? (It does sound like it is if you get ANY intellisense in that db).

e.g. at the bottom right of the query window, does it show [servername] (8.0 SP4) or [servername) (10.50 SP2) or something else?

The only other possibilities I know of are:
1. comment out any lines above your code - errors above the cursor can prevent it working
2. ensure SQLCMD mode is not enabled.
SQLCMD-mode.jpg
0
 

Author Closing Comment

by:chaverly
ID: 40463122
Thank you, thank you!!
0
 
LVL 18

Expert Comment

by:Simon
ID: 40463193
Glad to help. Out of interest, which of the possibilities was it?
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
In this article I will describe the Detach & Attach 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.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

729 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