Possibility of mismatch in LIKE operator behavior
The behavior of Sybase and SQL Server deviating in some some extends.
Here i have given that exceptional scenarios and how to handle that scenarios.
Other than the wild card '%',sybase and sql server behaves same.
So we need to take care of the wild card '%'.
If the key string has spaces in trailing position,Sybase automatically right trimming the Key string and search from the searching string only reach the end of the string.That means if the searching start position in the Target string is greater than the key string length from right to left,Sybase and SQL Server behaves same.If the Searching start position in the Target string is less than the key string length from right to left,Sybase right trimming key string and search but not SQL Server.
To get the better understanding i given the examples below.
Above given screenshots will help to understands the behavior of the Sybase and SQL Server for the usage of Like operator.To get the first row output in the sybase,keystring right trimmed and then searched.But in SQL Server space also taken as a character,so that we are getting only one record.To resolve this difference.Please follow the below changes.
SQL Server resolved like observation |
Now the output will be same in both Sybase and SQL Server.
Good information about SSMA message.
ReplyDeleteVB6 Migration
SQL Server Migration Assistant