How to split the full name into FirstName and LastName in SQL server?
Ask by Ashutosh Patel
Updated 15 Oct 2024
To split a
FullNameintoFirstNameandLastNamein SQL Server, you can use string functions like CHARINDEX, LEFT and RIGHT. Here is an example of how you can do this,Assuming you have an SQL table
Employeeswith a columnEmpNamethat contains the name in the format of “FirstName and LastName”,Here is the SQL Query to split the full name into first name and lastname
Example-