Today, I met one strange problem; when the following T-SQL statement was executed, the desired result was not presented:

The ltrim/rtirm cannot remove the space of data?

What happened to the ltrim and rtrim, I copied the value of '105151 ' and then verify the rtrim by the following statement:
The ltrim/rtirm cannot remove the space of data?

The function works well. So where is the problem? I used the Google to search the relevant topic, I found one post at the http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/ed5d3d85-a276-4487-be05-0a5c06f82722

And yes, it's the problem. I executed the following T-SQL statement and got the following result:
The ltrim/rtirm cannot remove the space of data?

It seems that the last character is the new line, not the space. Now, what need to be done is replace this symbol to space or empty. Thing became simple:
The ltrim/rtirm cannot remove the space of data?

相关文章: