<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Does adding a CHECK CONSTRAINT apply only to future data modifications? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830063#M4860906</link>
    <description>&lt;P&gt;Hi Volker,&lt;/P&gt;
&lt;P&gt;I have opened CR #711831 for this enhancement suggestion for the &lt;CODE&gt;ALTER TABLE ADD [WITH { CHECK | NOCHECK } ] CONSTRAINT ... CHECK&lt;/CODE&gt; syntax to be considered in a future SQL Anywhere release. Thank you for the product suggestion!&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2012 15:07:35 GMT</pubDate>
    <dc:creator>jeff_albion</dc:creator>
    <dc:date>2012-06-18T15:07:35Z</dc:date>
    <item>
      <title>Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaq-p/13830061</link>
      <description>&lt;P&gt;Testing with v12.0.1.3726 on Windows, I'm somewhat surprised that an ALTER TABLE ADD CONSTRAINT CHECK (whatsoever) does not seem to fail when the underlying data won't satisfy the check.&lt;/P&gt;
&lt;P&gt;I would have bet it is the other way, i.e. it is not possible to add a table check constraint when the existing data violate the check condition. - But I seem to be wrong...&lt;/P&gt;
&lt;P&gt;Does that mean adding a CHECK CONSTRAINT (here a table) will not check the existing table data, whereas adding a PRIMARY/UNIQUE KEY or an FOREIGN KEY surely does check the entity/referential integrity (and will fail accordingly) - so the check will only apply to future DML statements?&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(Note: The according table check does work for future modifications, so it's not the particular check condition that might be wrong...)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 10:23:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaq-p/13830061</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-06-11T10:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830062#M4860905</link>
      <description>&lt;P&gt;Ah, the typical steps: Once I post a question, I stumble over &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/intcolch.html"&gt;something "hidden" in the docs&lt;/A&gt;...&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Once a CHECK condition is in place, &lt;STRONG&gt;future values are evaluated&lt;/STRONG&gt; against the condition before a row is modified. When you update a value that has a check constraint, the constraints for that value and for the rest of the row are checked. &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So the &lt;STRONG&gt;future&lt;/STRONG&gt; tests are documented, however, it still does not really tell whether a check of the existing data base is done before &lt;EM&gt;"a CHECK condition is in place"&lt;/EM&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 10:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830062#M4860905</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-06-11T10:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830064#M4860907</link>
      <description>&lt;P&gt;You are correct, Volker - existing rows in a table are not verified that they satisfy a new or modified CHECK constraint.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 10:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830064#M4860907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-11T10:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830065#M4860908</link>
      <description>&lt;P&gt;And now I bet it has been that way all these years...&lt;/P&gt;
&lt;P&gt;FWIW, I guess I have mapped the semantics of the &lt;A href="http://msdn.microsoft.com/de-de/library/ms190273%28v=sql.105%29.aspx"&gt;MS SQL Server "ALTER TABLE ADD [WITH { CHECK | NOCHECK } ] CONSTRAINT ... CHECK"&lt;/A&gt; syntax to SQL Anywhere - as MS SQL &lt;EM&gt;does&lt;/EM&gt; check new constraints by default...&lt;/P&gt;
&lt;P&gt;One of the rare occasions where SQL Anywhere does not behave as expected (by me, at least)...&lt;/P&gt;
&lt;P&gt;Are there any plans to consider such a WITH CHECK feature, Glenn?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 11:09:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830065#M4860908</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-06-11T11:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830066#M4860909</link>
      <description>&lt;P&gt;No plans at this time, Volker.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 11:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830066#M4860909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-11T11:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830067#M4860910</link>
      <description>&lt;P&gt;Not checking the new constraint at ALTER time does seem to violate the rule "Watcom does things the way they should be done".&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 12:11:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830067#M4860910</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-06-11T12:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830068#M4860911</link>
      <description>&lt;P&gt;Yep, that's simply why I was surprised. - On the other hand, I haven't apparently run into issues with the current behaviour for years...&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 15:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830068#M4860911</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-06-11T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Does adding a CHECK CONSTRAINT apply only to future data modifications?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830063#M4860906</link>
      <description>&lt;P&gt;Hi Volker,&lt;/P&gt;
&lt;P&gt;I have opened CR #711831 for this enhancement suggestion for the &lt;CODE&gt;ALTER TABLE ADD [WITH { CHECK | NOCHECK } ] CONSTRAINT ... CHECK&lt;/CODE&gt; syntax to be considered in a future SQL Anywhere release. Thank you for the product suggestion!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2012 15:07:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-adding-a-check-constraint-apply-only-to-future-data-modifications/qaa-p/13830063#M4860906</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2012-06-18T15:07:35Z</dc:date>
    </item>
  </channel>
</rss>

