title: A questionon FOR JSON to delegate the JSON formatting to SQL Server
body: <p>The following statement retrieves data from a ODATA Service in SQL Server 2016 when the database context is set to AdventureWorks2014:</p>
  
  <pre><code> SELECT 'http://services.odata.org/V4/Northwind/Northwind.svc/$metadata#Products(ProductID,ProductName)/$entity' 
  AS '@odata.context', ProductID, Name as ProductName   
  FROM Production.Product 
  WHERE ProductID &lt;400
  FOR JSON AUTO  
  </code></pre>
  
  <p>When the 'master' is the context, it returns an error.
  However, Northwind is not present in the SQL Server 2016 but on an Instance of SQL Server 2012 on the same Windows 10 machine.</p>
  
  <p>Why did it work when the database context for running the query was 'AdventureWorks 2014'?</p>
  
  <p>The above query is from this link:
  <a href="https://msdn.microsoft.com/en-us/library/dn921897.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/dn921897.aspx</a></p>