Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data manipulation
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00806316
Message ID:
00806324
Vues:
12
The following code shows how you can do that with local variable but it can be easily adapted for your requirements.
DECLARE @email varchar(64)
SET @email = 'John.Doe@abc-stago.com'
SELECT LEFT(@email, CHARINDEX('.', @email)-1) AS fname,
	SUBSTRING(@email, CHARINDEX('.', @email)+1, 
			CHARINDEX('@', @email) - CHARINDEX('.', @email)-1) AS lname
>Can anyone suggest the syntax for extracting first name and last name from an email address within a sql table.
>
>Ex.
>John.Doe@abc-stago.com
>
>I need to insert first name : John and last name: Doe to a different table.
>
>Thank you,
>Daniel
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform