the following returning 2 errors: 'the definition column '0.63' must include data type.' 'the select list insert statement contains fewer items insert list. number of select values must match number of insert columns.' i understand need assign data type columns being inserted temp table don't quite understand how dynamic code however. if explanation on how @cols variable code working , specific issue. fldpk data type int , pivot fields i.e. @cols, float data type. declare @cols nvarchar(max), @query nvarchar(max); select @cols = stuff((select distinct ',' + quotename(fldci) fn_qryt_1() xml path(''), type ).value('.', 'nvarchar(max)') ,1,1,'') set @query = 'select fldpk, ' + @cols + ' ( select fldpk ,fldni ...
Comments
Post a Comment