Retrieve Data from a Specific Database Goal:  

I want to retrieve the value of [data].[Mobiles] when you use a query document that is for the database [test] (use [test])  

Problem:  

Based on picture two, I cannot retrieve the value from the database. Don't know what is the problem? The database [wwtest] does exist.  

Picture 1:  



Picture 2:
You want to use the three-part naming syntax:

&lt;database&gt;.&lt;schema&gt;.&lt;object&gt;
  wwtest  .  data  . Mobiles


...however you seem to be confused between your schema naming. In the table data.Mobiles, data is the schema, not dbo, so the naming should be wwtest.data.Mobiles.

dbo is also a schema, so there is no need to include it in your query when you are selecting from an object in a different schema.

Otherwise you end up with a completely different naming convention. The four-part naming sytax is as follows:

&lt;server&gt;.&lt;database&gt;.&lt;schema&gt;.&lt;object&gt;
 wwtest .   dbo    .  data  . Mobiles


In your example, you are looking for a database called dbo on a server called wwtest.

That is why you get the error:


  Could not find server 'wwtest' in sys.servers.