Hi,
I don't know if this is really a bug or a behaviour by design, but if you have to insert a string into a 'text' data type in MS-SQL (only tried on EXPRESS edition) using SetDatabaseString(), you are limited to a maximum of 8000 bytes (4000 characters with Unicode). So, if you must insert a larger string, avoid using bound variables... actually if you build the string directly in the query, it works! I hope this can be usefull for someone to save time and looking for a bug (just like it was for me).
Cheers!
SetDatabaseString() with 'text' data type with MS-SQL.
Re: SetDatabaseString() with 'text' data type with MS-SQL.
Really big strings should be inserted with BLOB.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: SetDatabaseString() with 'text' data type with MS-SQL.
In my case, the target database is not mine so I can't change any field. Can I use SetDatabaseBlob() into a 'text' field ? My program is just an import tool, the database then is handled by it own application.
Re: SetDatabaseString() with 'text' data type with MS-SQL.
Hmm, I have not tried but you can find out quick enough.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: SetDatabaseString() with 'text' data type with MS-SQL.
I checked and there is no hard limit on SetDatabaseString(), so it's probably the driver which is cutting it. SQL Server short string column is limited to 8000 bytes which exactly match your finding:
https://learn.microsoft.com/en-us/sql/s ... rver-ver16
https://learn.microsoft.com/en-us/sql/s ... rver-ver16