Declare @SelectSql nvarchar(max), @InsertSql nvarchar(max);
    SELECT @SelectSql = COALESCE(@SelectSql + ' UNION ALL ', '') +
					'Select '''+employeename+''' As employeename, datesold, itemsold, COUNT(itemsold)  As [totalsales] '
                    +'FROM '+employeename+' '
					FROM storeinfo;
    -- print @SelectSql;
    -- Exec(@inlinesql);
    SET @InsertSql = 'Insert into holdingtable ' + @SelectSql;
    print @InsertSql;
    exec (@InsertSql);

Not sure wheather it will help with performance, but surely is more elegant than cursor.


It it takes so long, consider aggregating data more often. 

Or you could have an indexed view with aggregation for each table. 

The problem is, we don't have enough information - the query you pasted is not complete (missing group by), so it is hard to tell wether problem is in grouping huge number of rows, or in inserting loads of rows.