anchor.diff:  %><%
         object_type.sql.constraints.each do |constraint|
   %>
  -IF  EXISTS (SELECT * FROM sys.check_constraints WHERE object_id = OBJECT_ID(N'<%= constraint.qualified_constraint_name %>') AND parent_object_id = OBJECT_ID(N'<%= object_type.sql.qualified_table_name %>'))
  -  ALTER TABLE <%= object_type.sql.qualified_table_name %> DROP CONSTRAINT <%= constraint.constraint_name %>
  -GO
   ALTER TABLE <%= object_type.sql.qualified_table_name %>
     WITH NOCHECK ADD CONSTRAINT <%= constraint.constraint_name %> CHECK ( <%= s(constraint.sql) %> )
   GO
  
positive.code:     end
    end
  %>
  
  IF EXISTS
    ( SELECT *
      FROM dbo.sysobjects
      WHERE id = OBJECT_ID(N'<%= data_module.sql.schema %>.spCheckConstraints') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
    DROP PROCEDURE <%= data_module.sql.schema %>.spCheckConstraints
  GO
  
  CREATE PROCEDURE <%= data_module.sql.schema %>.spCheckConstraints
  AS
  
negative.code: %><%
      object_type.sql.function_constraints.each do |constraint|
  %>
  CREATE FUNCTION <%= data_module.sql.schema %>.<%= s(object_type.name) %>_<%= s(constraint.name) %>
  (
  <%= constraint.parameters.collect{|parameter_name| a = object_type.attribute_by_name(parameter_name); "  @#{a.sql.column_name} #{a.sql.sql_type}"}.join(",\n") %>
  