One of my recent projects required me to create a Microsoft SQL Server view that displayed (among other information) and email address and its underlying domain. Microsoft SQL Server and T-SQL provide a few simple functions that, when used together, make this a fairly easy task.
So here’s the T-SQL example (with the important stuff highlighted):
SELECT EMAIL, RIGHT(EMAIL, LEN(EMAIL) - CHARINDEX('@', EMAIL)) AS 'DOMAIN' FROM MYTABLE
If you’re feeling brave, you can also try pure RegEx rather than use native functions.