Click here to Skip to main content
14,326,074 members
Rate this:
Please Sign up or sign in to vote.
See more:
my data is Rama Brothers, New Delhi in a column
I want the output Rama Brothers in a column and New Delhi in another column

What I have tried:

string_split('Rama Brothers, New Delhi',',')
Posted
Updated 22-Feb-18 23:09pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Nasty:
SELECT LEFT(CsvData, CHARINDEX(',', CsvData)), RIGHT(CsvData, LEN(CsvData) - CHARINDEX(',', CsvData)) FROM MyTable
Will do it, but you are much better off not storing your data like that at all.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100