title: Function like USE to point to a SQL database on a different server?
body: <p>In SQL Server, you can apply the <code>use</code> function to point a query to another database.  For example:</p>
  
  <p><code>USE databasename
  GO;</code></p>
  
  <p>Is there a function that allows you to point to a different database server and use a database on that server?  I would expect this to work, but no luck:</p>
  
  <p><code>USE [servername].databasename
  GO;</code></p>
  
  <p>I know I could just point the query to the database on the other server, but when I am dealing with production versus staging environments, it's more efficient to declare the server and database in the beginning of the query.  </p>
  
  <p>Thanks</p>