/* ------------------------ My Meta Content Here SEO ------------------------ */

Pages

Main Menu

Thursday, November 16, 2017

How to split comma separated value in sql server

How to split comma separated value in SQL server : ----- Approach 1:  Common Table Expression (CTE) ----- Lets call this function as Split2.  here we are using CREATE FUNCTION dbo.Split2 ( @strString varchar(4000)) RETURNS  @Result TABLE(Value BIGINT) AS begin     WITH StrCTE(start, stop) AS     (       SELECT  1, CHARINDEX(',' , @strString )       UNION ALL       SELECT  stop + 1, CHARINDEX(','...
Read More »

My Blog List