title: More than 2 columns in a CONCAT function
body: <p>In SQL Server 2012 I want to <code>concat</code> 5 columns into 1 but in the query it works but when I put in in a view it gives me an error like </p>
  
  <blockquote>
    <p>Msg 174, Level 15, State 1, Line 3<br>
    The CONCAT function requires 2 argument(s).</p>
  </blockquote>
  
  <p>What's the problem so I can fix it because <code>concat</code> is a good function for <code>concatenate</code> more than 1 column because if its null they make it empty..</p>
  
  <p>CODE:</p>
  
  <pre><code>SELECT        
     'Aan ' + A.Name AS 'Naam', 
     { fn CONCAT('T.a.v. ', C.Salutation + ' ', C.FirstName + ' ', C.MiddleName + ' ', C.LastName) } AS 'T.a.v.',   
     ISNULL(ISNULL(A.Address1_Line2, A.Address1_Line1), 
     C.Address1_Line2) AS 'Adres', 
     ISNULL(A.Address1_PostalCode + ' ' + A.Address1_City, A.Address2_PostalCode + ' ' + A.Address2_City) AS 'Woonplaats',
     'heer' + ' ' + ISNULL(C.MiddleName + ' ', N'') + ISNULL(C.LastName, N'') AS 'Aanhef'  
  FROM            
      dbo.Account AS A 
  FULL OUTER JOIN  
      dbo.Contact AS C ON A.Name = C.AccountIdName  
  WHERE 
      (C.Salutation = 'Dhr.') AND (A.Name IS NOT NULL) AND (A.StatusCode = 1) 
      AND (ISNULL(C.StatusCode, 1) = 1) OR (C.Salutation = 'dhr.') AND (A.Name IS NOT NULL) AND (A.StatusCode = 1) AND (ISNULL(C.StatusCode, 1) = 1)     
  </code></pre>