Professional Web Applications Themes

constraint in SQL Server2000 - Microsoft SQL / MS SQL Server

ALTER TABLE MyTable ADD CONSTRAINT CK_Percentage CHECK (([Percentage] >= 0 and [Percentage] <= 100 ) OR (Area = 0 AND Percentage IS NULL)) "Joe" <com> wrote in message news:phx.gbl... ...

  1. #1

    Default Re: constraint in SQL Server2000

    ALTER TABLE MyTable ADD CONSTRAINT CK_Percentage
    CHECK (([Percentage] >= 0 and [Percentage] <= 100 ) OR (Area = 0 AND
    Percentage IS NULL))


    "Joe" <com> wrote in message
    news:phx.gbl... 


    Jacco Guest

  2. #2

    Default Re: constraint in SQL Server2000

    That wasn't correct,
    This is:

    ALTER TABLE MyTable ADD CONSTRAINT CK_Percentage
    CHECK ((Area = 1 AND [Percentage] >= 0 and [Percentage] <= 100 ) OR (Area =
    0 AND
    Percentage IS NULL))


    "Jacco Schalkwijk" <co.uk> wrote in message
    news:%23qOkE$phx.gbl... [/ref]
    half 
    >
    >[/ref]


    Jacco Guest

  3. #3

    Default Re: constraint in SQL Server2000

    Dear Jacco Schalkwijk,
    Thanks for your constraint
    code.Its working fine.

    Thank You,
    Joe

    "Jacco Schalkwijk" <co.uk> wrote in message
    news:#qOkE$phx.gbl... [/ref]
    half 
    >
    >[/ref]


    Joe Guest

  4. #4

    Default Re: constraint in SQL Server2000 - Thanks Jacco Schalkwijk

    Dear Jacco Schalkwijk,
    Thanks for your corrections.
    Thank you,
    Joe
    "Jacco Schalkwijk" <co.uk> wrote in message
    news:phx.gbl... 
    = [/ref]
    > half 
    > >
    > >[/ref]
    >
    >[/ref]


    Joe Guest

Similar Threads

  1. Coldfusion and sql Server2000
    By Nikky2007 in forum Coldfusion Server Administration
    Replies: 7
    Last Post: September 4th, 08:38 PM
  2. Forms Authentication with SQL Server2000
    By Andy G in forum ASP.NET Security
    Replies: 1
    Last Post: October 19th, 06:47 PM
  3. How to add a constraint
    By David in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: August 8th, 05:24 PM
  4. Unique constraint
    By Aaron Bertrand - MVP in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 8th, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139