/* ------------------------ 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 »

Monday, February 27, 2017

How to get odd/even value from array and display in table using Javascript

var dataArr = ["1","Maths","2","Science"]; Add a bare bones table to a div. $("#subjectTable").append(' '); For each table row loop over the array in steps of 2 (i+=2). oddPositionVal is the first element in the step, evenPositionVal is the second element. Build the row HTML and then append it to the table. for (var i = 0, l = dataArr.length; i < l; i+=2) {   var oddPositionVal = dataArr[i];   var evenPositionVal = dataArr[i + 1];  ...
Read More »

My Blog List