Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data manipulation
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00806316
Message ID:
00806324
Views:
13
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform