Reply to Re: Remove the last carriage return and line feed from sql text field

Your name:

Reply:


Posted by Erland Sommarskog on 06/15/07 21:08

(whitej77777@gmail.com) writes:
> On Jun 12, 5:14 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
>> (whitej77...@gmail.com) writes:
>> SELECT substring(col, 1,
>> len(str) - CASE WHEN str LIKE '%' + char(13)
>> THEN 1
>> ELSE 0
>> END)
>
> I did mean that the data type was actually text which is what is
> probably causing the most problem.

So did my SELECT work for you?

I can spot one change that is needed: use datalength() rather than
len(), as len() does not work past the 8000-character limit.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original 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

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