title: Querying Across Servers
body: <p>I am trying to query across servers.</p>
  
  <p>The error message I got was: </p>
  
  <blockquote>
    <p>Access to the remote server is denied because no login-mapping exists.</p>
  </blockquote>
  
  <p>I found this SO post:</p>
  
  <p><a href="https://stackoverflow.com/questions/1144051/selecting-data-from-two-different-servers-in-sql-server">Stackoverflow Post #1</a></p>
  
  <p><a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addlinkedserver-transact-sql?view=sql-server-2017" rel="nofollow noreferrer">Microsoft Documentation</a></p>
  
  <p>I am having trouble setting this up though:</p>
  
  <p>Let's say I have the following parameters:</p>
  
  <pre><code>user login = 'john.doe'
  server = 'abc'
  instance = '123'
  schema: 'dbo'
  database: 'restaurant_menu'
  </code></pre>
  
  <p>sql server version = '2016'</p>
  
  <p>I am not sure how to set this up. This is what I came up with so far. Also, this is just a one-time query that may get ran up to a couple more times, but that is it.</p>
  
  <pre><code>EXEC master.dbo.sp_addlinkedserver 
  @server = N'abc',
  @provider = N'SQLNCLI',
  @srvproduct = 
  @datasrc = 
  @location = -- I don't think I need to fill this part out
  @provstr =
  @catalog =
  </code></pre>