Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Get first name and last name from full name string in SQL

DECLARE @FullName    VARCHAR(50) = 'Mark Zuckerberg'

SELECT SUBSTRING(@FullName, 1, CHARINDEX(' ', @FullName) - 1) AS [First Name],
       SUBSTRING(@FullName, CHARINDEX(' ', @FullName) + 1, LEN(@FullName)) AS [Last Name]
Source by www.sql-server-helper.com #
 
PREVIOUS NEXT
Tagged: #Get #full #string #SQL
ADD COMMENT
Topic
Name
1+9 =