title: Obtaining size of rows using DataLength and hard-coded column names fails
body: <p>I am trying to write a SQL query that will show me the records that are largest in size along with the User Names associated with the record. </p>
  
  <pre><code>SELECT 
      Data.Id,
      User.UserName, 
      (
      ISNULL(DATALENGTH(ColumnA), 1) + 
      ISNULL(DATALENGTH(ColumnB), 1) + 
      ISNULL(DATALENGTH(ColumnC), 1)
      ) AS SizeOfRow
  FROM Data
      LEFT JOIN User ON Data.UserId = User.UserId 
  ORDER BY SizeOfRow DESC
  </code></pre>
  
  <p>When I run this I get the error <code>Conversion failed when converting from a character string to uniqueidentifier.</code> I am not sure where I am going wrong here. If I remove the <code>JOIN</code> to the <code>User</code> table then the SQL runs without issue. However, I really want to include the <code>UserName</code> field and I am not sure why it's addition is causing a problem.</p>
  
  <p>EDIT: I should mention that <code>ColumnA</code> is a datatype of <code>UniqueIdentifier</code>. While <code>ColumnB</code> and <code>ColumnC</code> are both <code>varchar(max)</code>.</p>