title: SQL Server constraint won't save the way I define it
body: <p>I noticed it before that SQL Server (or Management Studio) would "adjust" Check constraint when I create it via GUI. Most of the time it works OK and correct. But this particular constraint get changed every time. I even tried to do it in script but it would revert to incorrect one every time. Why?</p>
  
  <p>This is what I run:</p>
  
  <pre><code>ALTER TABLE [dbo].[DSPTripAssignment] WITH CHECK 
    ADD CONSTRAINT [CK_DSPTripAssignment_CarrierKey_DriverKey] 
    CHECK (([CarrierKey] IS NULL AND NOT [DriverKey] IS NULL) 
           OR ([DriverKey] IS NULL AND NOT [CarrierKey] IS NULL))
  GO
  </code></pre>
  
  <p>This is what it reverts to (see missing braces around OR - kills logic)</p>
  
  <pre><code>ALTER TABLE [dbo].[DSPTripAssignment] WITH CHECK 
    ADD CONSTRAINT [CK_DSPTripAssignment_CarrierKey_DriverKey] 
    CHECK (([CarrierKey] IS NULL AND NOT [DriverKey] IS NULL 
           OR [DriverKey] IS NULL AND NOT [CarrierKey] IS NULL))
  GO
  </code></pre>
  
  <p>Or, maybe you can suggest how to write this check better? I want to ensure that one of those keys specified but not both.</p>