title: Storing varchar(max) & varbinary(max) together - Problem?
body: <p>I have an app that will have entries of both varchar(max) and varbinary(max) data types. I was considering putting these both in a separate table, together, even if only one of the two will be used at any given time. </p>
  
  <p>The question is whether storing them together has any impact on performance. Considering that they are stored in the heap, I'm thinking that having them together will not be a problem. However, the varchar(max) column will be probably have the <strong><em>text in row</em></strong> table option set.</p>
  
  <p>I couldn't find any performance testing or profiling while "googling bing," probably too specific a question? </p>
  
  <p>The SQL Server 2008 table looks like this:</p>
  
  <pre><code>Id
  ParentId
  Version
  VersionDate
  StringContent - varchar(max)
  BinaryContent - varbinary(max)
  </code></pre>
  
  <p>The app will decide which of the two columns to select for when the data is queried. The string column will much used much more frequently than the binary column - will this have any impact on performance?</p>