Wednesday, 20 September 2017

How can I check if an SQL result contains a newline character?

SELECT *
FROM your_table
WHERE your_column LIKE '%' + CHAR(10) + '%'
Or...
SELECT *
FROM your_table
WHERE CHARINDEX(CHAR(10), your_column) > 0

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive