title: SQL Server Error: maximum number of prefixes. The maximum is 3. with join syntax
body: <p>Trying to run a cross-server update:</p>
  
  <pre><code>UPDATE ASILIVE.CustomerManagementSystem.dbo.Sessions
  SET ASILIVE.CustomerManagementSystem.dbo.Sessions.VarianceAmount=Variances.VarianceAmount
  FROM ASILIVE.CustomerManagementSystem.dbo.Sessions
      INNER JOIN Variances
      ON ASILIVE.CustomerManagementSystem.dbo.Sessions.SessionGUID = Variances.SessionGUID
  WHERE ASILIVE.CustomerManagementSystem.dbo.Sessions.VarianceAmount &lt;&gt; Variances.VarianceAmount
  </code></pre>
  
  <p>Gives the error:</p>
  
  <pre><code>Msg 117, Level 15, State 2, Line 5
  The number name 'ASILIVE.CustomerManagementSystem.dbo.Sessions' contains 
  more than the maximum number of prefixes. The maximum is 3.
  </code></pre>
  
  <p>What gives?</p>
  
  <hr>
  
  <h2>See also</h2>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2404503/sql-server-error-maximum-number-of-prefixes-the-maximum-is-3-with-subselect">SQL Server Error:  "maximum number of prefixes. The maximum is 3" with subselect syntax</a><br>
  (<em>Deals with sub-select syntax; this question deals with join syntax</em>)</li>
  </ul>
  
  <hr>
  
  <p><strong>Unimportant research:</strong>  </p>
  
  <p>i tried randomly aliasing things to <code>s</code>:</p>
  
  <pre><code>UPDATE ASILIVE.CustomerManagementSystem.dbo.Sessions s
  SET s.VarianceAmount=Variances.VarianceAmount
  FROM ASILIVE.CustomerManagementSystem.dbo.Sessions s
      INNER JOIN Variances
      ON s.SessionGUID = Variances.SessionGUID
  WHERE s.VarianceAmount &lt;&gt; Variances.VarianceAmount
  </code></pre>
  
  <p>But that doesn't work:</p>
  
  <pre><code>Msg 117, Level 15, State 2, Line 5
  The number name 'ASILIVE.CustomerManagementSystem.dbo.Sessions' contains 
  more than the maximum number of prefixes. The maximum is 3.
  </code></pre>
  
  <p>Hamlin suggested added brackets:</p>
  
  <pre><code>UPDATE [ASILIVE].[CustomerManagementSystem].dbo.Sessions
  SET [ASILIVE].[CustomerManagementSystem].dbo.Sessions.DisciplineVarianceAmount=DisciplineVariances.VarianceAmount
  FROM [ASILIVE].[CustomerManagementSystem].dbo.Sessions
      INNER JOIN DisciplineVariances
      ON [ASILIVE].[CustomerManagementSystem].dbo.Sessions.SessionGUID = DisciplineVariances.SessionGUID
  WHERE [ASILIVE].[CustomerManagementSystem].dbo.Sessions.DisciplineVarianceAmount &lt;&gt; DisciplineVariances.VarianceAmount
  </code></pre>
  
  <p>but that doesn't work:</p>
  
  <pre><code>Msg 117, Level 15, State 2, Line 5
  The number name 'ASILIVE.CustomerManagementSystem.dbo.Sessions' contains
  more than the maximum number of prefixes. The maximum is 3.
  </code></pre>