Question

  Asked: Mar 16 2008   2:51 AM GMT
  Asked by: Star monkey


Create error message for check constraint


check constraint, ERROR MESSAGE

I was wondering if there was a way to create an error message that displays when data is entered into a table in the wrong format. (Check constraint).

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



When data is entered into a column of the wrong data type an error will be returned already.

For example is a column has the data type of INT and you try to put text data into the column the database will return an error message.

If you want a text field and you add a constraint to it and the new value does not meet the requirements of the constraint an error message will return an error message.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Database.

Looking for relevant Database Whitepapers? Visit the SearchOracle.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   Mar 16 2008  5:19AM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.