• ppcx (5/21/2009)


    3 gives:

    Msg 207, Level 16, State 1, Line 2

    Invalid column name 'EmployeeId'.

    Is your database collation case sensitive? That would be the reason "EmployeeId" is invalid, because it's actually "EmployeeID" (capital D) which is fine for case insensitive collation but an not for case sensitive.

    Query 3 should give an error because EmployeeId is in the SELECT list but is not contained in the GROUP BY clause (or in an aggregate function within the SELECT list).