views:

43

answers:

3

I stored (or think I stored) some text from a textbox that is effectively 'lol\ncats'

In SQL management studio it comes up in the description has 'lol cats'

How can I check if the \n is there or not?

+3  A: 
SELECT *
FROM your_table
WHERE your_column LIKE '%' + CHAR(10) + '%'
LukeH
Worked great, thanks
SLC
A: 
SELECT * 
FROM Table 
WHERE PATINDEX('%' + CHAR(13) + CHAR(10) + '%', Column) > 0
Nungster
+1  A: 
using char(13) for '\r' and char(10) for '\n'

SELECT *
FROM your_table
WHERE your_column LIKE '%' + CHAR(10) + '%'

or

SELECT *
FROM your_table
WHERE your_column LIKE '%' + CHAR(13) + CHAR(10) + '%'
Sachin Shanbhag
+1 for noting the characters that `CHAR(10)` and `CHAR(13)` correspond to.
Brad