Q:

SQL Server Value <> Constraint

We have a uniqueidentifier column in one of our SQL tables which is set as the primary key. For various reasons we don't want this to be auto-generated by SQL.
I want to be able to add a constraint on this column to disallow the value '00000000-0000-0000-0000-000000000000'
Can this be easily achieved?

A:

alter table YourTable add constraint CHK_YourTable_GUID 
    check (guid <> '00000000-0000-0000-0000-000000000000')

Example at SQL Fiddle.

