Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Get the User Name and Domain Name from an Email Address

DECLARE @Email     VARCHAR(50) = 'helper@sql-server-helper.com'

SELECT SUBSTRING(@Email, 1, CHARINDEX('@', @Email) - 1) AS [User Name],
       SUBSTRING(@Email, CHARINDEX('@', @Email) + 1, LEN(@Email)) AS [Domain Name]
Source by www.sql-server-helper.com #
 
PREVIOUS NEXT
Tagged: #Get #User #Name #Domain #Name #Email #Address
ADD COMMENT
Topic
Name
9+7 =