can I get an email address with a domain name code example
Example: Get the User Name and Domain Name from an Email Address
DECLARE @Email VARCHAR(50) = '[email protected]'
SELECT SUBSTRING(@Email, 1, CHARINDEX('@', @Email) - 1) AS [User Name],
SUBSTRING(@Email, CHARINDEX('@', @Email) + 1, LEN(@Email)) AS [Domain Name]