patternsqlMinor
invalid object on a table that exists
Viewed 0 times
objectthatexistsinvalidtable
Problem
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: https://stackoverflow.com/questions/14409788/is-not-a-foreign-key-column-and-cannot-be-used-here
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:
It is nothing more than a table of holidays used to calculate the business days between two dates.
edit
Any reference to the table will do (which is why I didn't add a query).
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.
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]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tblHoliDate](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Holiday] [date] NOT NULL,
[Description] [varchar](50) NOT NULL,
[DOW] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GOIt is nothing more than a table of holidays used to calculate the business days between two dates.
edit
Any reference to the table will do (which is why I didn't add a query).
SELECT * FROM tblHoliDateMouse 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.
Solution
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.
Try refreshing the cache for Intellisense in Management Studio and this should fix it.
Context
StackExchange Database Administrators Q#33502, answer score: 3
Revisions (0)
No revisions yet.