[CR #401753] If you have enabled parallel plan, and use select distinct into a table with an identity column and one of the select distinct list items is an expression or an implicit convert() expression, this query may cause a stack trace. Here is an example query:
create table tt(id numeric(5) identity not null, c1 int, c2 int) go insert into tt select distinct c1, c2+1 from t go
Workaround: Disable parallel plan for the query. For the example query, use:
insert into tt select distinct c1, c2+1 from t (parallel 1)