title: SQL Server varchar(MAX) datatype in delphi using RemObjects
body: <p>Got a request to change comment field max size in application. Before had it set to <em>varchar(500)</em>, so after reading documentation i have decided to change data type of the field from <em>varchar(500)</em> to <em>varchar(max)</em>. Database accepted changes without any problems (using Microsoft SQL Server Management Studio 2005 and Microsoft SQL Server Management Studio 2008 for database management).
  Then i went on changing the software. Software is written in <em>Delphi</em> with <em>RemObjects</em> to communication with database. So I changed the <em>TDASchema</em> for the server, it mapped my new <em>varchar(max)</em> field as <em>String(65536)</em> data type (got me a little worried there about such an explicit static size, but I went on). Then I <em>Retrieved DataTable Schema</em> for my <em>TDAMemDataTable</em> object, which updated all the fields.</p>
  
  <p>I started the application and decided to see whether my database will accept changes on this specific changed field. I have edited one of the records and clicked the button to synchronize the <em>DataSet</em> with server and got such a fail message:</p>
  
  <blockquote>
    <p>The data types varchar(max) and text are incompatible in the equal to operator</p>
  </blockquote>
  
  <p>I interpret it as that my server object (the one that maps database fields with RemObjects objects) have mapped field data types to wrong data types in RemObjects.</p>
  
  <p>How can this be resolved? What are the alternatives?</p>
  
  <p>P.S. In this release Build .1267 logs from RemObjects it clearly states that:</p>
  
  <blockquote>
    <p>fixed: DataSnap: fails to post updates to MSSQL 2005 VARCHAR(MAX)</p>
  </blockquote>
  
  <p>I am using build version .1067. Wonder if update will fix the problem</p>
  
  <p><strong>P.P.S. After update to the latest version of RemObjects, the problem persists.</strong></p>