Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting an "invalid object" warning error in the Management Studio query. Any query against the table works and it links correctly to another table. I am investigating an error that I'm getting in C#. See: This is the latest attempt to ferret out what may be going wrong. My linq queries against this table fail, but when I go to classic ADO.NET using SQL strings they work perfectly. Is it possible that this "invalid object" is causing C#/linq to kill the connection?
How do I get the table to stop the "invalid object" error. There are two tables, the following is the simplest one:

USE [Report]
CREATE TABLE [dbo].[tblHoliDate](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Holiday] [date] NOT NULL,
    [Description] [varchar](50) NOT NULL,
    [DOW] [int] NULL

It is nothing more than a table of holidays used to calculate the business days between two dates.
Any reference to the table will do (which is why I didn't add a query).

SELECT * FROM tblHoliDate

Mouse over the table name to see the error.
The exact error is "invalid object name tblHolidate". This only occurs on mouse-over and the results of any SQL query against the table are complete and correct.

share|improve this question
My guess? You're in the context of the wrong database. Regardless, run a SQL Trace or XE session and see what exactly is happening on the database. Then you'll have your answer. – Thomas Stringer Jan 24 '13 at 19:15
Without seeing the exact error text, I can only think of a few things it could be: 1) the object actually doesn't exist 2) wrong database 3) the current principle doesn't have permissions on the object. – Thomas Stringer Jan 24 '13 at 19:37
The warning on mouse over should be from the auto complete feature, it's my guess. Try refreshing the cache for Intellisense in Management Studio. – Marian Jan 24 '13 at 20:27
@ThomasStringer: they're pretty unrelated, as I guess. OP just wanted to verify a hunch (where warning of non existing table might be somehow related to an error he gets using LINQ, but not in normal SQL or ADO). – Marian Jan 24 '13 at 22:03
@Marian Oh absolutely, I couldn't agree more. A classic case of IntelliSense not refreshing wouldn't cause that error when running a query. – Thomas Stringer Jan 24 '13 at 22:06
up vote 3 down vote accepted

The warning on mouse over should be from the auto complete feature, it's my guess. I've met that a few times. Especially with newly created tables in a session. Try refreshing the cache for Intellisense in Management Studio and this should fix it.

share|improve this answer
This, unfortunately, did not fix my original problem which has to do with accessing this table using linq. :( – Dave Jan 24 '13 at 21:07
These are unrelated issues, I'm afraid. This one is a Management Studio warning, that one is an application error. – Marian Jan 24 '13 at 21:25
I had the same problem with linq accessing the database, turned out my connection string was pointing to the wrong database – Matthew Lock May 8 '15 at 2:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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