title: SQL Server pulling data from different server
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1942228/how-can-i-connect-to-an-external-database-from-a-sql-statement-or-a-stored-proced">How can I connect to an external database from a sql statement or a stored procedure?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a database server 'A'(SQL Server 2008) and database server 'B' (SQL Server 2005).</p>
  
  <p>I need to pull some data  from a database on server 'B' when I am on server 'A'.  </p>
  
  <p>I tried this query on Server 'A':</p>
  
  <pre><code>SELECT *
  FROM  [ServerName].[DataBaseName].[dbo].[TableName]
  </code></pre>
  
  <p>I am getting this error : </p>
  
  <blockquote>
    <p>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'</p>
  </blockquote>
  
  <p>Is there some thing wrong with my query or do we need to change any setting on the server
  so that I will be able to access the database.</p>