Professional Web Applications Themes

Is there any property like Validation Text in MS Access in SQL Server 2000? - Microsoft SQL / MS SQL Server

In MS Access, there are 2 very usefull properties that DB Designer can use to provide restriction to value entered by user in a certain field. MS Access 97 or above MS SQL Server 2000 1. Validation Rule - Constraint 2. Validation Text - - (none) Suppose that I have table name TUser contain field name "Credit". What DB Designer want to is value entered in this field must be greater than 1. If user enter value out of range, User must receive a certain text in order to inform what go wrong with value they have just entered. In ...

  1. #1

    Default Is there any property like Validation Text in MS Access in SQL Server 2000?

    In MS Access, there are 2 very usefull properties that DB
    Designer can use to provide restriction to value entered
    by user in a certain field.

    MS Access 97 or above MS SQL Server 2000
    1. Validation Rule - Constraint
    2. Validation Text - - (none)

    Suppose that I have table name TUser contain field
    name "Credit". What DB Designer want to is value entered
    in this field must be greater than 1. If user enter value
    out of range, User must receive a certain text in order to
    inform what go wrong with value they have just entered.

    In MS Access, we can inform user by put information on
    Validation Text. So that whenever user try to input Credit
    with value 0, user will receive informatiojn "Credit must
    be greater than 1". Then they know what's next to correct
    the problems. It's a very usefull property to programmer
    too. Since such text can be shown through exception that
    raise. (I use borland delphi 7 )

    In MS SQL Server 2000, if DB Designer design constraint
    name "CK_Credit_Error" which has constraint expression
    ([Credit]) > 1. If user try to input 0 to this field,
    Error message below shown

    "UPDATE statement conflicted with COLUMN CHECK
    constraint 'CK_Credit_error'. The conflict occurred in
    database 'TestDB', table 'TUSER', column 'CREDIT'.
    The statement has been terminated."


    That message doesn't help user to find out what to do in
    order to correct error. So I wonder

    1. If SQL Server 2000 has the way to set Validation Text
    to show message corresponding to constraint violation.
    Where?

    2. If there's no such property, Can I modified some where
    in SQL Server 2000 (whether in Stored procedure or
    something else) to display just constraint name so that I
    can put some text to inform user what to do in constraint
    name like "CK_Credit_error You must enter credit with
    value greater than 1" to correct problem temporaly.

    But in my opinion, SQL Server 2000 is more powerfull DBMS
    than MS Access, should they do much better? Is there any
    one tell microsoft about this? Will they enhance SQL
    Server 2000 with more feature compare with MS Access? I
    hope they will, soon. Thanks.
    Regard,
    thep Akkho

    Pornthep Guest

  2. #2

    Default Re: Is there any property like Validation Text in MS Access in SQL Server 2000?

    There's no similar option in SQL Server to validation text. You should trap
    the error and format the message for the user.
    As for suggesting features in the product, you can submit those to
    com. SQL Server PM's go over all of the suggestions
    submitted to this link.

    --
    BG, SQL Server MVP
    Solid Quality Learning
    www.solidqualitylearning.com


    "thep Akkho" <com> wrote in message
    news:003001c359cd$1019a630$gbl... 


    Itzik Guest

  3. #3

    Default Re: Is there any property like Validation Text in MS Access in SQL Server 2000?

    The only way I can think of doing it is to access tables via
    stored procedures. You could trap the error in the SP and
    pass an error string back to the client...

    Either way you have to create your own error handling code.
    To be honest, it's probably much easier to implement it in
    within the client software.

    Access is a strange hybrid product. I like to think of it as a
    visual data-manipulation tool. The Validation Text is useful
    in it's own way, but, it doesn't support localisation or unicode,
    which limits it severely.

    Personally I've never used the Validation Text property in a
    serious way. My preference is always to perform error trapping
    in the interface, I've always worked on the premise that bad
    data shouldn't even be sent to the server, never mind rejected
    by it.


    Regards,
    Danny


    "thep Akkho" <com> wrote in message news:003001c359cd$1019a630$gbl... 


    Daniel Guest

Similar Threads

  1. Custom Server Control Property Validation Issue
    By Jim-M in forum ASP.NET Building Controls
    Replies: 4
    Last Post: May 12th, 11:11 PM
  2. Access 2000 or SQL Server 2000
    By Denis in forum ASP Database
    Replies: 1
    Last Post: January 25th, 03:38 PM
  3. Is there validation text (like MS Access) in SQL Server 2000?
    By Pornthep in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: August 4th, 06:02 PM
  4. Replies: 2
    Last Post: July 30th, 05:07 PM
  5. Replies: 0
    Last Post: July 6th, 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