Search db table column for a return or linefeed

select * from address a
where patindex( ‘%’+CHAR(13)+CHAR(10)+’%’,a.address2) >0

select count(*) from address a
where patindex( ‘%’+CHAR(13)+’%’,a.address1) >0

10 = linefeed
13 = carriage return
9 = tab
8 = backspace

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s