erikTsomik
asked on
extract email address from the string
I have the string from the MS exchange server which lists the email address. However, the email address list like this John Smith <john.smith@test.com>.. I need to get just the email john.smith@test.com in sql
if it has name
declare @email varchar(100) = 'John Smith <john.smith@test.com>'
select substring(@email, charindex('<',@email)+1, charindex('>',@email)-charindex('<',@email)-1)
john.smith@test.com
ASKER
what if it is combination so in one record has a name and the other record has not name like this 111111111@txt.att.net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome
Open in new window