Chris, I've created a Numbers table with the same column name as you (Number), and I cannot get the code to fail the same way as you have with the dupes and all.
What version of SQL Server do you have and are you using either QA or SMS for the interface? I've seen the Oracle version of TOAD produce such things, but never QA or SMS. Also, single or multi CPU on your box?
--Jeff Moden
Change is inevitable... Change for the better is not.