I have table that one of the fields needs to be cleaned up. The basic table structure is as follows:
create table testComments(id int, comments text)
In the comments column some of the rows had to many "carriage returns" (char(13)) and "line feed" (char(10)). If there is more then one grouping per line I need to be able to modify it. The basic select statement that I have so far is a follows:
select count(id)
from testComments
where comments like('%' + char(13) + char(10) + char(13) + char(10) + '%')
This query will find the results
"This is a entry in the testComments crlf
crlf
In the comments field that works"
Although the query will not find the results if the comment is listed as follows:
"This is an entry in the testComments crlf
crlf
crlf
That will not work"
The query will only return a count of 1 entry for the above data. Any idea how I can change the query to return a count of 2?
ntext
,text
, andimage
data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Usenvarchar(max)
,varchar(max)
, andvarbinary(max)
instead.Char(10)
(lf).