I am doing a project with VS2010 using C#.
I have a local database (.sdf file). Here is the example content of my database:
Column1
This should work.
SELECT SUBSTRING([Name], 0, CHARINDEX(' ', [Name], 0)) [FirstName],
SUBSTRING([Name], CHARINDEX(' ', [Name], 0) + 1, LEN([Name])) [LastName]
EDIT:
SELECT SUBSTRING([Name], 0, CHARINDEX(' ', [Name], 0)) [FirstName],
SUBSTRING([Name], CHARINDEX(' ', [Name], 0) + 1, LEN([Name])) [LastName]
FROM
(
SELECT 'Ned Stark' [Name] UNION
SELECT 'Tyrion Lannister' [Name] UNION
SELECT 'Daenerys Targaryen' [Name] UNION
SELECT 'Robert Baratheon' [Name]
) n
Just replace the part after from with you table and the column [Name] with you column.