|
Posted by Erland Sommarskog on 05/31/07 21:56
Sonny (SonnyKMI@gmail.com) writes:
> Anyone have any idea? ID2 is my partition column, why the SQL 2K
> doesn't see it. It is a part of primary key, having checking
> constrain, and no other constrain on it. Am I missing something?
Yes, <> is not a permitted operator. You need to rewrite
CHECK ([ID2] <> 1015)
to
CHECK ([ID2] < 1015 OR [ID2] > 1015)
Another story is whether this view will be very efficient. You should
probably add an index on ID2, or put it first in the primary key.
--
Erland Sommarskog, SQL Server MVP, esquel@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
Navigation:
[Reply to this message]
|