Hi all,
I need to find sum of the column name.
i have tried with the below code but am getting below error,
please drop me a solution for this.
select ' + sum(cast(@Scolumns as int)) + ' as Total FROM #temp_MatchesTotal';
Error msg:
Conversion failed when converting the nvarchar value ',ISNULL([2015_April], 0) AS [2015_April],ISNULL([2015_August], 0) AS [2015_August],ISNULL([2015_July], 0) AS [2015_July],ISNULL([2015_June], 0) AS [2015_June],ISNULL([2015_May], 0) AS [2015_May]' to data type int.
thanks in advance.