Hi Luis,
we are using the FreeTDS (mssql) driver for PHP.
I've solved the problem and upgraded successfully by updating the ntext fields to nvarchar(max) in our database, prior to performing the Moodle upgrade script.
I used the following script - solution 4 from
http://dba.stackexchange.com/questions/47797/convert-all-ntext-columns-to-nvarcharmax
DECLARE@sql NVARCHAR(MAX)= N'USE Eventlogic;';SELECT@sql += N' ALTER TABLE '+ QUOTENAME(s.name)+'.'+ QUOTENAME(t.name)+' ALTER COLUMN '+ QUOTENAME(c.name)+CASEWHEN c.system_type_id =99THEN' N'ELSE' 'END+'VARCHAR(MAX)'+CASEWHEN c.is_nullable =0THEN' NOT NULL'ELSE''END+'; UPDATE '+ QUOTENAME(s.name)+'.'+ QUOTENAME(t.name)+' SET '+ QUOTENAME(c.name)+' = '+ QUOTENAME(c.name)+'; PRINT '''+ QUOTENAME(s.name)+'.'+ QUOTENAME(REPLACE(t.name,'''',''''''))+'.'+ QUOTENAME(c.name)+' ('+CONVERT(VARCHAR(12), COUNT(*)OVER(PARTITIONBY c.[object_id]))+' columns)'';'FROM sys.columns AS c INNERJOIN sys.tables AS t ON c.[object_id]= t.[object_id]INNERJOIN sys.schemas AS s ON t.[schema_id]= s.[schema_id]WHERE c.system_type_id IN(35,99);SET@sql += N' PRINT ''Total columns updated: '+CONVERT(VARCHAR(12),@@ROWCOUNT)+''';';PRINT@sql;
--EXEC sp_executesql @sql;
This actually lists the changes that you are going to make, and you can then uncomment the EXEC statement at the bottom when you are ready to apply them.
This script took 10 minutes and 44 seconds to run against our database.
After this had completed I performed the upgrade from 2.3.11 -> 2.6.2 directly and this worked without any problems and quickly.
Hope this helps other people who may encounter this problem.
All the best,
Michael