|
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]
|