Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
using sql server 2005I am returning a string and sometimes at the end of the string there is a carriage return. I only want to delete the carriage return at the end of the string if it exists.how do I do this?thanksMC
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts
Posted - 2011-04-06 : 14:40:06
If there is only a carriage return, you can do it as
replace(YourString,char(13),'')
But you may also have a line-feed (ascii code 10). If you want to remove that as well do this: