• If you'd like something that's set based and will most likely perform a bit better than looking at each individual character give the following a shot... Like the above I made an assumption that the lastname starts with a capital, no requirement that the firstname be capitalized.

    Also you'll see the number 1000 used in my character expressions, you can adjust that down to the limit of your column left or actually do the Len calculation if you like... Just remember to Keep the Collation as that's what gives you the case sensative bit...

    CREATE TABLE #test (

    fullname VARCHAR(20)

    )

    INSERT INTO [#test]

    SELECT 'RobertJain' UNION ALL

    SELECT 'JansonStuart' UNION ALL

    SELECT 'IsmailSummit' UNION ALL

    SELECT 'JohnAbharaham'

    SELECT [fullname],

    LEFT([fullname], PATINDEX ('%[A-Z]%', SUBSTRING([fullname], 2, 1000) COLLATE Latin1_General_BIN)) AS FirstName,

    SUBSTRING(fullname, PATINDEX ('%[A-Z]%', SUBSTRING([fullname], 2, 1000) COLLATE Latin1_General_BIN)+1, 1000) AS LastName

    FROM [#test]

    DROP TABLE [#test]

    To help us help you read this[/url]For better help with performance problems please read this[/url]