That just doesn't work even for just a stand alone first name never mind a first name with a space in it. Here's the proof...DECLARE @yourtable TABLE (First_Name VARCHAR(20),FNameShouldBe VARCHAR(20), MiShouldBe CHAR(1)) INSERT INTO @yourtable (First_Name,FNameShouldBe,MiShouldBe)-- SELECT 'Anne','Anne',NULL UNION ALL --Had to comment out because blew up!!! SELECT 'Anne K','Anne','K' UNION ALL SELECT 'Anne Marie','Anne Marie',NULL UNION ALL SELECT 'Anne Marie K','Anne Marie','K' SELECT First_Name AS OriginalFirstName, LEFT(First_Name,CHARINDEX(' ',First_Name)-1) AS 'First_Name', RIGHT(First_Name,CHARINDEX(' ',First_Name)+1) AS 'Middle_Initial', FNameShouldBe, MiShouldBe FROM @yourtable Not including the fact that there could be periods, multiple adjacent spaces, and a wealth of other naming problems, the following will do the trick... SELECT FirstName = CASE WHEN RIGHT(First_Name,2) LIKE ' [A-Z]' THEN LEFT(First_Name,LEN(First_Name)-2) ELSE First_Name END, MI = CASE WHEN RIGHT(First_Name,2) LIKE ' [A-Z]' THEN RIGHT(First_Name,1) ELSE NULL END FROM @yourtable
Of course, you will need to replace "@yourtable" with the real table name.--Jeff Moden