Skip to main content

Previous versions, without quotes:

ALTER TABLE dbo.[voyage_completeness_check_period] ADD CONSTRAINT [c_voyage_completeness_check_period_reservation_month] CHECK ([reservation_month]>=1 AND  reservation_month]<=12)

New version, with quotes while the datatype is integer:

ALTER TABLE dbo.ovoyage_completeness_check_period] ADD CONSTRAINT Tc_voyage_completeness_check_period_reservation_month] CHECK ( reservation_month]>='1' AND Dreservation_month]<='12')

 

This was changed to support constraints based on date. This poses no problem for integers since the check constraint is still treated as integer values.


Ok, not a big problem, but, don’t you think this could cause a decrease in performance?


The execution plan for a table with quoted check constraints compare to a table with non-quoted check constraints is identical. Also the check constraint is translated to integer so it has the same result as without the quotes:

table with quoted check constraint:

 

table with un-quoted check constraint:

 

 

 


Reply