title: SQL Server  Text Datatype Maxlength = 65,535?
body: <p>Software I'm working with uses a text field to store XML. From my searches online, the text datatype is supposed to hold 2^31 - 1 characters. Currently SQL Server is truncating the XML at 65,535 characters every time. I know this is caused by SQL Server, because if I add a 65,536th character to the column directly in Management Studio, it states that it will not update because characters will be truncated.</p>
  
  <p>Is the max length really 65,535 or could this be because the database was designed in an earlier version of SQL Server (2000) and it's using the legacy <code>text</code> datatype instead of 2005's? </p>
  
  <p>If this is the case, will altering the datatype to <code>Text</code> in SQL Server 2005 fix this issue?</p>