No column was specified for column %d of ''%.*ls''
One or more of the aggregate or computed columns in your select list have not been supplied with an alias.
Supply an alias for all aggregate or computed column. For example:
select pub_name, "count"=count(*)
into #t
from publishers p, titles t
where p.pub_id = t.pub_id
group by pub_name