Adaptive Server truncates entries to the specified column length without warning or error, unless you set string_rtruncation on
. See the Reference Manual: Commands.
MSSQL always detect truncation of strings and the option STRING_RTRUNCATION does not exist. Here is an excerpt of jTDS SAfeTest.testDataTruncException()
Statement stmt = con.createStatement();
if (!con.getMetaData().getDatabaseProductName().toLowerCase().startsWith("microsoft")) {
// By default Sybase will silently truncate strings,
// set an option to ensure that an exception is thrown.
stmt.execute("SET STRING_RTRUNCATION ON");
}