table design

  • How can I enforce a constraint on a field in a table so that it allows only the value " CAT"

  • Just curious, but if every entry is going to have the same value, why are you storing it at all?:hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • I want to do this only for the future entries, the existing data shud not change

  • you could put an insert trigger that sets it to "CAT" and an update trigger that disallows the update if it is set to "CAT" assuming that this is the rule that you are trying to enforce.


  • create a CHECK CONSTRAINT...


    Ronald San Juan | SQL DBA
    ID 710124 ~ Code "Northwind"

  • I think

    we can add a constraint for that field with expression columnname='CAT' and un check the box where it has " check for existing data"

    how is tht?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply