How to check if a text exists within another in SQL Server 2008 / How to split SQL Column based on Comma
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
Showing posts with label Substring Function SQL Server. Show all posts
Showing posts with label Substring Function SQL Server. Show all posts
Friday, June 3, 2011
Subscribe to:
Posts (Atom)