I am working in a SQL Server environment and have a varchar(100)
column called AdditionalData
. Sometimes, but not always, this column will contain an email. I need help building a query that only returns rows in which AdditionalData
has an email address in it.
Asked
Active
Viewed 2,845 times
0

marc_s
- 732,580
- 175
- 1,330
- 1,459
-
I swear SE's community is a bunch of vultures. Please link the duplicated question. I made a conscious effort look if I was asking a similar question. – Nov 07 '14 at 19:18
-
You should see the link to the question in the blue box above your original text. [Here's another link](http://stackoverflow.com/questions/229824/tsql-email-validation-without-regex). Also, dont feel as though you are being punished for not finding a duplicate. Marking duplicates is a way that we help you and others looking for the same or similar answer. It can get a little overwhelming how fast it all happens. – crthompson Nov 07 '14 at 21:50
1 Answers
1
Assuming that all the emails contains @:
SELECT * FROM myTable WHERE AdditionalData LIKE '%@%';

bksi
- 1,606
- 1
- 23
- 45
-
I love SE's way of making me feel stupid. I searched/over thought this way to much. Thank you for the simple answer. – Nov 07 '14 at 19:14