Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 domain name filter

Author  Topic 

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-02-27 : 12:15:28
Hi,
How do i filter domain name only?

declare @email varchar(50),
@domain varchar(50)
set @email = 'aa@abc.com;bb@cc.com;ddd@xyz.com;mnop@abc.com'
set @domain = substring(@email, charindex('@', @email)+1, 50)
print @domain

i want to print out like this:
abc.com,cc.com,xyz.com

mfemenel
Professor Frink

1421 Posts

Posted - 2009-02-27 : 12:53:02
Wasn't this just posted the other day?

Mike
"oh, that monkey is going to pay"
Go to Top of Page

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-02-27 : 13:38:36
nop
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2009-02-27 : 14:42:34
Really? This seems remarkably similar:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=120640&SearchTerms=filter,domain


Mike
"oh, that monkey is going to pay"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-27 : 15:00:17
Locking duplicate topic.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -