Not only did I appreciate this script, I *USE* it. I made a slight change to shrink the output a tad (shown below). The negative to my approach is that I must manually delete the very last "union all" piece, but I can live with that. Thanks Boss!
set @script = 'select ''select '' + ' + substring(@values, 11, len(@values)) + ' + '') union all '' from ' + @table;
if ( @is_identity = 1 ) begin
print ('set identity_insert ' + @table + ' on');
end
print 'insert into ' + @table + ' (' + substring(@columns, 3, len(@columns)) + ')'
exec sp_executesql @script;
if ( @is_identity = 1 ) begin
print ('set identity_insert ' + @table + ' off');
end