• FYI:

    In SQL 2000, the code runs without any errors--data is input into the table and the query returns 1,2,3,4,5 and 6.

    In SQL 2005, database in compatibility mode 80, the data is input into the table and the query returns both the above result set and the error message.

    In SQL 2005, database in compatibility mode 90, no data is input into the table and the query returns only the error message.

    Unfortunately I don't have SQL 2008. Still a fascinating outcome of one sample code run against various versions of SQL Server and database compatibility mode.

    (BTW--got it wrong as I first cross ckecked against SQL 2000).