Question : Using a geometry type check constrint in sql sever 2008

Hello,
I'm trying to add a check constraint to a geography column in sql server 2008.  I'd like to make sure that [geom].[STGeometryType()] = "Point", however, when I try to create a constraint with this as the expression, it fails.

I know I can do [geom].[STSrid] = (4326) etc, and I'm assuming this works because it is a property rather than method.  Is there a way to do check constraints using the instance methods?

Thanks,
Chirs

Answer : Using a geometry type check constrint in sql sever 2008

Point should be in single quotes like this:

[geom].[STGeometryType()] = 'Point'

Greg


Random Solutions  
 
programming4us programming4us