In the MS SQL Server 2008 query, the link is "Invalid object name", but it still works

The following query has a reddish underscore for the server through the table for this bit [OtherServer].[UAT_DB].[dbo].[profileTable] and when you hover over the Invalid Object Name , but it is interesting if I execute the line, it returns the correct entries from the related table servers:

 select * from [OtherServer].[UAT_DB].[dbo].[profileTable] 
+7
sql-server sql-server-2008
source share
3 answers

Updating the intellisense local cache may fix it.

In the query window:

  • Press Ctrl + Shift + R
  • Go to the Edit menu β†’ Intellisense β†’ Refresh Local Cache
+10
source share

Intellisense in sql server works fine for queries on a single server. But when it comes to running a request on a remote server, then he really does not know how to deal with it.

To be sure, intellisense will not work with a remote server that has a version that does not support intellisense. For example, if the remote database has compatibility level 80 (SQL 2000).

+11
source share

I had to use ALIAS to make it work.

Example:

 select * from [OtherServer].[UAT_DB].[dbo].[profileTable] myalias where myalias.profileid = 1 
0
source share

All Articles