You can use the combination of CharIndex and Substring function in SQL to split the string based on delimiter.
Here is a way to split a column based on Comma
Select LTRIM(SUBSTRING(EmpAddress, CHARINDEX( ',',EmpAddress)+1,len(EmpAddress)))from #TempEmployee
We have used Ltrim to remove any leading spaces
Here is a way to split a column based on Comma
Select LTRIM(SUBSTRING(EmpAddress, CHARINDEX( ',',EmpAddress)+1,len(EmpAddress)))from #TempEmployee
We have used Ltrim to remove any leading spaces
0 comments:
Post a Comment