Tuesday, October 16, 2012

Sybase to SQL Server MIgration Issues

Concatenating NULLABLE char column with NOT NULLABLE char column: 

                While concatenating the Nullable character column with the NOT Nullable column, Sybase right trimming the first column(Nullable character column) and then concatenating but SQL Server directly concatenating .So SQL Server gives the output along with the trailing spaces for the first column.
 

While concatenating the Nullable character column with the NOT Nullable column, Sybase right trimming the first column(Nullable character column) and then concatenating but SQL Server directly concatenating .So SQL Server gives the output along with the trailing spaces for the first column.Assume the table with two columns of nullable char(10) and not nullable char (10).
There is a record like below.
 When concatenating the two columns , SYBASE will gives the output without space like below.
SELECT column1+column2,* FROM dbo.test
 When concatenating the two columns ,SQL SERVER gives the output with space like below.
SELECT column1+column2,* FROM dbo.test
 Finally Sybase, right trimming the nullable character column while concatenation but not SQL Server.
Solution:
Resolve the above given scenario and get the same result as like as Sybase, it’s mandatory to add the rtrim() for the first column like below.
SELECT rtrim (column1) +column2,* FROM dbo.test
Don’t use ANSI Padding off to resolve this issue. This is not recommendable in future version.

Please click here to know about sybase to sql server migration issues 

No comments:

Post a Comment