I\'m trying to execute this on MS-SQL but returns me an error just at the Group by line
update #temp
Set Dos=Count(1)
From Temp_Table2010 s
where Id=s.Total
You can't use an aggregate in an UPDATE query, for starters - though you didn't include the error message in your original question, I suspect that's what it's telling you.
You'll need to calculate the aggregate before your update and store the results in a temp table, and then join to that table to do your update.