Hi everyone,
I need to split a sentence into it's seperate words and those words can then be in their own columns.
I have managed to split the first word by doing the following:
SELECT
BRANCHNAME,
SUBSTRING(BRANCHNAME, 1, NULLIF(CHARINDEX(' ', BRANCHNAME) - 1, -1)) AS [FirstWord],
SUBSTRING(BRANCHNAME, CHARINDEX(' ', BRANCHNAME) + 1, LEN(BRANCHNAME)) AS [Rest]
from LOTUS_REP.dbo.GARNADDRESS
where BRANCHNAME = 'Bright Home & Hardware'
I now have a problem in order to split the last three 'Home','&','Hardware'
Could anyone maybe suggest a solution of how I can split the remaining 3 into their own columns ?
"We know nothing but, that what we know is not the truth..." - Me
I need to split a sentence into it's seperate words and those words can then be in their own columns.
I have managed to split the first word by doing the following:
SELECT
BRANCHNAME,
SUBSTRING(BRANCHNAME, 1, NULLIF(CHARINDEX(' ', BRANCHNAME) - 1, -1)) AS [FirstWord],
SUBSTRING(BRANCHNAME, CHARINDEX(' ', BRANCHNAME) + 1, LEN(BRANCHNAME)) AS [Rest]
from LOTUS_REP.dbo.GARNADDRESS
where BRANCHNAME = 'Bright Home & Hardware'
I now have a problem in order to split the last three 'Home','&','Hardware'
Could anyone maybe suggest a solution of how I can split the remaining 3 into their own columns ?
"We know nothing but, that what we know is not the truth..." - Me