Home All Groups Group Topic Archive Search About

SQL 2005 redundant error message

Author
30 Jun 2006 4:27 PM
DWalker
When you modify a view in SQL 2005 Management Studio, and there's an
incorrect column name (that you typed in the SQL pane), you get a silly
error message:

Invalid column name "Categorry"
Invalid column name "Categorry"

It's so nice they named it twice!

And it's not like I had 2 errors or anything.  Strange.

David Walker

Author
30 Jun 2006 10:38 PM
Erland Sommarskog
DWalker (n***@none.com) writes:
> When you modify a view in SQL 2005 Management Studio, and there's an
> incorrect column name (that you typed in the SQL pane), you get a silly
> error message:
>
> Invalid column name "Categorry"
> Invalid column name "Categorry"
>
> It's so nice they named it twice!
>
> And it's not like I had 2 errors or anything.  Strange.

Let me guess, you have something like: 

    Categorry IN (1, 2)

SQL Server performs some transformations of the query, before it checks
for correct column names. One of these transformations is changing IN
to a bunch of OR operations. This results in double error messages.

I've seen this for other constructs as well.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button