anchor.diff:  
   <%= banner("Foreign Keys for #{object_type.sql.qualified_table_name}") %>
   <% object_type.sql.foreign_keys.each do |foreign_key| %>
  -IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'<%= foreign_key.qualified_foreign_key_name %>') AND parent_object_id = OBJECT_ID(N'<%= object_type.sql.qualified_table_name %>'))
  -  ALTER TABLE <%= object_type.sql.qualified_table_name %> DROP CONSTRAINT [<%= foreign_key.foreign_key_name %>]
  -GO
   ALTER TABLE <%= object_type.sql.qualified_table_name %>
     WITH NOCHECK ADD CONSTRAINT [<%= foreign_key.foreign_key_name %>] FOREIGN KEY (<%= foreign_key.attribute_names.collect{|a| q(object_type.attribute_by_name(a).sql.column_name)}.join(', ') %>)
     REFERENCES <%= foreign_key.referenced_object_type.sql.qualified_table_name %> (<%= foreign_key.referenced_attribute_names.collect{|a| q(foreign_key.referenced_object_type.attribute_by_name(a).sql.column_name)}.join(', ')  %>)
  
positive.code: %><%
        object_type.sql.triggers.each do |trigger|
  %>
  IF  EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'<%= trigger.qualified_trigger_name %>'))
    DROP TRIGGER <%= trigger.qualified_trigger_name %>
  GO
  CREATE TRIGGER <%= trigger.qualified_trigger_name %> ON <%= object_type.sql.qualified_table_name %>
  <%
    if trigger.after && !trigger.after.empty?
  
negative.code: %><%
        object_type.sql.constraints.each do |constraint|
  %>
  ALTER TABLE <%= object_type.sql.qualified_table_name %>
    WITH NOCHECK ADD CONSTRAINT <%= constraint.constraint_name %> CHECK ( <%= s(constraint.sql) %> )
  GO
  