You are here: Re: Replacing the second carriage return « MsSQL Server « IT news, forums, messages
Re: Replacing the second carriage return

Posted by Hugo Kornelis on 10/06/06 21:27

On 6 Oct 2006 12:46:15 -0700, asturt@us.ci.org wrote:

>However, if there is a less convoluted way of doing this, I'd love to
>know.

Hi asturt,

You can simplify it a bit using STUFF:

SELECT @MyString = STUFF(@MyString, CHARINDEX(CHAR(13), @MyString,
CHARINDEX(CHAR(13), @MyString, 0)+1), 2, '')

Note that the third (length) argument of the STUFF has to be 2, not 1,
because you have to replace both the CR and the LF.

--
Hugo Kornelis, SQL Server MVP

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация