• I may be wrong here, but this bug could have been around even longer. SQL2008 doco http://msdn.microsoft.com/en-us/library/ms188029(v=sql.100).aspx also shows the same comment about the effect of GROUP BY clause on the 'Identity' property inheritence, but if I run the following code on our 2008 installation, the results of the final SELECT statement show a 1 in the 'is_identity' column of CustomerID for both objects.

    create table #customer (CustomerID int identity, city int)

    insert into #customer values (1),(2),(3),(4),(2),(3),(4),(3),(4),(4)

    Select CustomerID, count(city) as City_Count

    into #temp

    from #customer group by CustomerID

    select * from tempdb.sys.columns

    I note that unless I provide a name for the aggregation, SQL2008 will complain that 'An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.'

    From a 'usefulness' perspective, I also note that since CustomerID is an IDENTITY column, the results of the COUNT(city) aggregate should always be 1. Maybe the fact that aggregation against an Identity column has such limited usefulness has kept the bug hidden for all this time? 😀