Parsename, read all about it, here
DECLARE @FullName VARCHAR(100)
SET @FullName = 'John Doe'
SELECT PARSENAME(REPLACE(@FullName, ' ', '.'), 2) AS [FirstName],
PARSENAME(REPLACE(@FullName, ' ', '.'), 1) AS [LastName]
SET @FullName = 'John Doe'
SELECT PARSENAME(REPLACE(@FullName, ' ', '.'), 2) AS [FirstName],
PARSENAME(REPLACE(@FullName, ' ', '.'), 1) AS [LastName]
No comments:
Post a Comment