Another possibility is that the text is written to the database in an unsupported format. In my case the text contained a hidden character (U+FEFF the UTF BOM character) which SQL Server does not support.