Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home

Reporting And Data Export: Maximum String Length, nvarchar and ntext columns

Last updated on 5 September 2023

M-Files Reporting

Overview

Ntext column has some restrictions in SQL, also the ntext, text, and image data types will be removed in a future version of SQL Server. For more information see https://learn.microsoft.com/en-us/sql/t-sql/data-types/ntext-text-and-image-transact-sql?view=sql-server-ver16

For now, the Maximum String Length in Advanced Vault Settings "maxStringLength" has been used to cut the metadata field values to first 4000 characters during Reporting. This was done because those were saved to SQL column of datatype nvarchar(4000) which is good for further SQL usage. 

However, before August release 23.8, if "maxStringLength" is set to a value higher than 4000 (e.g. 4001) it creates an ntext SQL column.

Solution

August release 23.8 and newer:

Make sure to use Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) as the data provider. This is per user guide https://userguide.m-files.com/user-guide/latest/eng/Data_export_details.html

August release 23.8 and older: 

Set value maxStringLength = 4000 or any other smaller number in M-Files Admin then press "Save".

image.png

After this, a restart of M-Files services "MFServer" and "MFDataExport" should revert the data type used in reporting module exports. Further exports to the reporting database will now produce a column value with the correct data type nvarchar(4000).

Still need help?